purpose
The combination of Keras and Tensorflow is very convenient. However, there are a lot of pits.
* the question is:
AttributeError: module ‘tensorflow. Python. The framework. The ops’ has no attribute’ _TensorLike
because keras import and tensorflow keras import of primary and secondary, there are differences in structure;
Modify the
Br> from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras. optimzimport RMSprop
Modified
the from tensorflow. Keras. Models import Sequential
the from tensorflow. Keras. The layers import Dense, Dropout, Activation
the from tensorflow. Keras. Optimizers import RMSprop
There are twists and turns in between
The previous python3.6 + keras that were initially searched were as :
tensorflow_backend.py line703
def is_tensor(x):
return isinstance(x, tf_ops._TensorLike) or tf_ops. Is_dense_tensor_like (x)
return type modified as:
return isinstance(x, core_tf_types.or tf_ops. Is_dense_tensor_like (x)
* the result changes one bug and introduces another:
* ValueError: updates
argument is not supported during eager execution. And this bug is only an updated version, but mine is the latest version; Tangled for a long time, a face covered in circles.
* finally restore the modification, return to search the original wrong solution. Find the one above.
conclusion
Try more than one problem modification. If one problem modification introduces another, then either follow the problem modification. Or go back to the origin and find the answer again. That is, if you change one problem and introduce another, then maybe you started with the wrong solution.
Read More:
- AttributeError: module ‘keras.backend‘ has no attribute ‘eager‘
- Tensorflow reported an error when using session module: attributeerror: module ‘tensorflow’ has no attribute ‘session’, which has been solved
- AttributeError: module ‘pkg_resources‘ has no attribute ‘declare_namespace‘
- [error] attributeerror: module ‘SIP’ has no attribute ‘setapi‘
- Attributeerror: module “Seaborn” has no attribute “lineplot”
- Attributeerror: ‘module’ object has no attribute ‘handlers’ — Python sub module import problem
- AttributeError: module ‘os’ has no attribute ‘mknod’
- Error reporting: attributeerror: module ‘******* has no attribute’ ******* and other problems are solved
- AttributeError: module ‘onnxruntime‘ has no attribute ‘InferenceSession‘
- Attributeerror: the solution of module ‘urllib’ has no attribute ‘quote’
- AttributeError:module ‘seaborn‘ has no attribute ‘tsplot‘
- AttributeError: module ‘numpy‘ has no attribute ‘getbuffer‘
- AttributeError: module ‘sacrebleu‘ has no attribute ‘compute_bleu‘
- Solving attributeerror: module ‘urllib’ has no attribute ‘request’
- AttributeError:module“seaborn” has no attribute “lineplot”
- AttributeError: module ‘onnxruntime‘ has no attribute ‘InferenceSession‘
- Solve the problem of attributeerror: module ‘SciPy’ has no attribute ‘Stats’
- Solving attributeerror: module ‘Matplotlib’ has no attribute ‘plot‘
- AttributeError: module ‘torch’ has no attribute’_six’ [The problem is solved after restart]
- AttributeError: module ‘scipy.misc’ has no attribute ‘imread’