Errors are reported as follows:
Solution:
Reason: use tensorflow1 instead of tensorflow2.
Check the tensorflow version information first:
pip list
Then add the following code at the beginning of the code:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
Read More:
- Python AttributeError: module ‘tensorflow‘ has no attribute ‘InteractiveSession‘
- [Solved] AttributeError: module ‘tensorflow‘ has no attribute ‘distributions‘
- [Solved] Pytorch call tensorboard error: AttributeError: module ‘tensorflow’ has no attribute ‘gfile’
- [Solved] AttributeError: module ‘tensorflow._api.v2.train‘ has no attribute ‘AdampOptimizer‘
- [Solved] AttributeError: module ‘tensorboard.summary._tf.summary‘ has no attribute ‘merge‘
- AttributeError: module ‘time‘ has no attribute ‘clock‘ [How to Solve]
- [How to Solve]AttributeError: module ‘scipy’ has no attribute ‘io’
- [Solved] AttributeError: module ‘pandas‘ has no attribute ‘rolling_count‘
- [Solved] AttributeError: module ‘PIL.Image‘ has no attribute ‘open‘
- [How to Solve]AttributeError: module ‘scipy’ has no attribute ‘stats’
- [Solved] AttributeError: module ‘distutils‘ has no attribute ‘version‘
- AttributeError: module ‘enum‘ has no attribute ‘IntFlag‘ [How to Solve]
- [Solved] AttributeError: module ‘logging‘ has no attribute ‘Handler‘
- [Solved] AttributeError: module ‘setuptools._distutils‘ has no attribute ‘version‘
- [Solved] AttributeError: module ‘selenium.webdriver‘ has no attribute ‘Chrome‘
- [Solved] AttributeError: module ‘time‘ has no attribute ‘clock‘
- [Solved]AttributeError: module ‘urllib’ has no attribute ‘quote’
- [Perfectly Solved] attributeerror: module ‘SciPy. Misc’ has no attribute ‘toimage’ error
- [Solved] AttributeError: partially initialized module ‘xlwings’ has no attribute ‘App’
- from keras.preprocessing.text import Tokenizer error: AttributeError: module ‘tensorflow.compat.v2‘ has..