0

This is a follow-up question to the one posted at ImportError: cannot import name 'keras_tensor' from 'tensorflow.python.keras.engine'. I tried the answer provided and followed the versioning guidelines provided at https://github.com/tensorflow/addons, and I'm still getting an error:

09:38 $ python
Python 3.8.6 | packaged by conda-forge | (default, Oct  7 2020, 19:08:05)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow; tensorflow.__version__
'2.2.0'
>>> import tensorflow_addons; tensorflow_addons.__version__
'0.11.2'
>>> from tensorflow.python.keras.engine import keras_tensor
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'keras_tensor' from 'tensorflow.python.keras.engine' (/home/artur/miniconda3/envs/institution_name/lib/python3.8/site-packages/tensorflow/python/keras/engine/__init__.py)

So the python version is 3.8.6, tensorflow is 2.2.0, and tensorflow_addons is 0.11.2. I can import them, but not the specific module. Any thoughts on what could be happening?

Aku
  • 526
  • 4
  • 17
  • `from tensorflow.python.keras.engine import keras_tensor` works in Tensorflow 2.5. –  Jun 25 '21 at 04:01

0 Answers0