addons: Packaged Addons don't run on tf-nightly-2.0

While packaging 0.2.0 release of addons, I realized that if the pip package was built against tensorflow==2.0.0-alpha0 the installed package would not correctly work on the tf2-nightly install.

The error is:

NotFoundError: /usr/local/lib/python3.6/dist-packages/tensorflow_addons/custom_ops/image/python/_distort_image_ops.so: undefined symbol: _ZN10tensorflow12OpDefBuilder10SetShapeFnEPFNS_6StatusEPNS_15shape_inference16InferenceContextEE

Digging in further I thought that something may have gone awry in the build for this version, but when I checked a previous version (0.1.1) I noticed it also failed to load on the current nightly. Typically I’ve seen this type of error when using gcc>=5 but the solution provided is to set D_GLIBCXX_USE_CXX11_ABI=0 which we do

Some things to note in the investigation:

  • 0.1.1 and 0.1.0 were built against the tf2-nightly at the time of packaging and did import fine with that package at the time (It also works on tf2-alpha)
  • If I build 0.2.0 against the current nightly then it does successful import against tf2-nightly (This is why our nightly builds succeed). However, it’ll then fail to import against TF2-alpha

Has there been a recent change in how tf2-nightly is packaged compared to tf2-alpha? Going forward we can mention that addons should be used with tf2-alpha, and just use nightly for testing… but there seems to be an underlying issue that needs to be fixed.

Colab Notebooks:

Addons-0.1.1 + Alpha Addons-0.1.1 + Nightly Addons-0.2.0 + Alpha Addons-0.2.0 + Nightly

cc @gunan @yifeif

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (10 by maintainers)

Most upvoted comments

Alternatively we could setup a nightly addons package which would work. But that requires #76 to be finished

Build from source would be the only way for now (tip: use the docker image recommended in the contributing guide). As soon as we can get a tf2-beta version that includes the new so versioning then it’ll be compatible with both again.

Just a note though: there was a breaking change last night which will be fixed once #135 gets merged