This error was now fixed on Keras 2.4.3 :
attributeerror: module 'tensorflow.python.framework.ops' has no attribute '_tensorlike'
However, if you are still on an older version of Keras, then try updating your Keras to 2.4.3 or a newer version or have a look at the following possible workarounds. Depending on the version of Tensorflow/Keras you are using, these solutions may help or not.
Possible solution #1
Use tensorflow.keras instead of keras when importing libraries
Possible solution #2
is_tensor in file
keras/backend/tensorflow_backend.py as follows:
from tensorflow.python.framework import tensor_util def is_tensor(x): return tensor_util.is_tensor(x) #return isinstance(x, tf_ops._TensorLike) or tf_ops.is_dense_tensor_like(x)
This solution may work for various 2.x versions of Tensorflow