Addons: Import error not compatible with tensorflow v 2.0

Created on 11 Jul 2020  路  14Comments  路  Source: tensorflow/addons

System information

  • Windows 10
  • Tf v 2.0 downloaded with conda
  • Trying to use pip install tensorflow_addons
  • python 3.7
  • GPU support:

Trying to download tensorflow_addons with
pip install tensorflow_addons
which works but when I try to import tensorflow_addons

import tensorflow as tf
import tensorflow_addons as tfa

I get the following error:
UserWarning: Tensorflow Addons supports using Python ops for all Tensorflow versions above or equal to 2.2.0 and strictly below 2.3.0 (nightly versions are not supported).
The versions of TensorFlow you are currently using is 2.0.0 and is not supported.
Some things might work, some things might not.
If you were to encounter a bug, do not file an issue.
If you want to make sure you're using a tested and supported configuration, either change the TensorFlow version or the TensorFlow Addons's version.
You can find the compatibility matrix in TensorFlow Addon's readme:
https://github.com/tensorflow/addons

AttributeError: module 'tensorflow_core.keras.utils' has no attribute 'register_keras_serializable'

Any ideas why this is or how to install the correct version of tensorflow_addons to get this to work?

build

Most helpful comment

You wrote:

pip install tensoflow_addons

From the compatibility matrix that you want with the old Tensorflow 2.0.0 I see:
pip install tensorflow_addons == 0.6.0

All 14 comments

Ceck python and c++ compatibility matrix at https://github.com/tensorflow/addons#python-op-compatility

@bhack v 2.0 is compatible so I do not see the issue.

You wrote:

pip install tensoflow_addons

From the compatibility matrix that you want with the old Tensorflow 2.0.0 I see:
pip install tensorflow_addons == 0.6.0

pip install tensorflow_addons==0.6.0

ERROR: Could not find a version that satisfies the requirement tensorflow_addons==0.6.0 (from versions: 0.7.0, 0.7.1, 0.8.1, 0.8.2, 0.8.3, 0.9.0, 0.9.1, 0.10.0)
ERROR: No matching distribution found for tensorflow_addons==0.6.0

Can you past the output of pip --version?

pip 20.0.2 from C:\Users\alecd\Anaconda3\envs\tensorflow\lib\site-packages\pip (python 3.7)

Ok it is good: pip install tensorflow-addons==0.6.0

Yep still getting the same error about no matching distribution:

ERROR: Could not find a version that satisfies the requirement tensorflow-addons==0.6.0 (from versions: 0.7.0, 0.7.1, 0.8.1, 0.8.2, 0.8.3, 0.9.0, 0.9.1, 0.10.0)
ERROR: No matching distribution found for tensorflow-addons==0.6.0

The package is available as you can see in https://pypi.org/project/tensorflow-addons/0.6.0/#files.
Probably it is your conda setup cause we don't support conda currently as you can see from https://github.com/tensorflow/addons/issues/201.

Ok thanks. I will set up no environment using pip and hopefully that will work. Thanks for your help!

Let us know if it works in the env pip so that we can close this.
You could also subscribe to the conda ticket but I don't expect too much updates soon on that thread.

It looks as though TFA 0.6 was not published for Windows which is why you're not finding a pip package.

I do want to clarify that users can pip install tensorflow-addons inside of a conda environment, however the tensorflow installed in that environment must have also been installed through pip.

Sorry there is nothing we can do to support Windows on v0.6. My advice would be to upgrade to at least TF2.1 where we have whl's available for TFA on Windows.

Good. I didn't know that we had no Win support in the old days :smile:

Was this page helpful?
0 / 5 - 0 ratings