Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module 'tensorflow.python.framework.ops' has no attribute '_TensorLike' #42

Open
taktikal17 opened this issue Jun 5, 2017 · 8 comments

Comments

@taktikal17
Copy link

Hi,

I was trying to run:
make_image_analogy.py images/arch-mask.jpg images/arch.jpg images/arch-newmask.jpg out/arch

When I got this:

AttributeError: module 'tensorflow.python.framework.ops' has no attribute '_TensorLike'

Any idea how to fix that?

Thank you!

@RSudarsanan
Copy link

Hi,
I had this same error when I was trying to import keras which uses tensorflow in the backend.
Then I re-installed tensorflow with virtual environment. Now the error has gone. I am not sure if this may help. I followed the "Installing with Virtualenv" section in this site : https://www.tensorflow.org/install/install_linux
And then maybe you can run the program in the virtual environment

@husnejahan
Copy link

AttributeError: module 'tensorflow.python.framework.ops' has no attribute '_TensorLike'

Same error when using keras where tensorflow as backend

@ghost
Copy link

ghost commented Sep 10, 2018

Hi,
I have tried by installing the tensorflow with virtualenv but the erroe was same.
Any idea how to fix that?

(venv) pi@raspberrypi:~ $ python3 /home/pi/Desktop/final\ face/facenet\ face\ recognition/facenet.py
Using TensorFlow backend.

** (facenet.py:27420): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
Traceback (most recent call last):
File "/home/pi/Desktop/final face/facenet face recognition/facenet.py", line 19, in
FRmodel = faceRecoModel(input_shape=(3, 96, 96))
File "/home/pi/Desktop/final face/facenet face recognition/inception_blocks_v2.py", line 229, in faceRecoModel
X = ZeroPadding2D((3, 3))(X_input)
File "/home/pi/.local/lib/python3.5/site-packages/keras/engine/base_layer.py", line 414, in call
self.assert_input_compatibility(inputs)
File "/home/pi/.local/lib/python3.5/site-packages/keras/engine/base_layer.py", line 279, in assert_input_compatibility
K.is_keras_tensor(x)
File "/home/pi/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 470, in is_keras_tensor
if not is_tensor(x):
File "/home/pi/.local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 478, in is_tensor
return isinstance(x, tf_ops._TensorLike) or tf_ops.is_dense_tensor_like(x)
AttributeError: module 'tensorflow.python.framework.ops' has no attribute '_TensorLike'

@th4t-gi
Copy link

th4t-gi commented Oct 7, 2018

I got the exact same error as @taktikal17 but with a keras.layers.LSTM instance. I am running this on OSX 10.11 so I had to install tensorflow/keras with virtualenv. Pretty sure my OS is my problem but it might not...

@wanlitengfei
Copy link

i use version tensorflow==1.10.0 with no problem

@Jay2109
Copy link

Jay2109 commented Jul 31, 2020

I am getting same error while using ImageAI

@Rahul2991
Copy link

Just fix the imports like
from keras import import Sequential

to this:
tensorflow.keras import Sequential

Similarly for other imports starting with 'from keras'

@mansi-aggarwal-2504
Copy link

I am getting same error while using ImageAI

I am also getting this error while using ImageAI. Referring to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants