Error occurred while running tensorflow:
AttributeError: module 'tensorflow' has no attribute 'InteractiveSession'
This is not the first mock exam error in the package, because the module Session has been removed in the new Tensorflow 2 version, and the code is changed to:
sess = tf.InteractiveSession()
Replace with:
sess = tf.compat.v1.InteractiveSession()
Similarly, if there are similar “TF. * *” codes in the code, you should add “compat. V1.” after them.
If you are not used to it, you can reduce the version of tensorflow
pip install tensorflow==1.14
Read More:
- [Solved] AttributeError: module ‘tensorflow‘ has no attribute ‘distributions‘
- [Solved] Error: AttributeError: module ‘tensorflow‘ has no attribute ‘placeholder‘
- [Solved] AttributeError: module ‘tensorflow._api.v2.train‘ has no attribute ‘AdampOptimizer‘
- [Solved] Pytorch call tensorboard error: AttributeError: module ‘tensorflow’ has no attribute ‘gfile’
- Python3.7 AttributeError: module ‘time‘ has no attribute ‘clock‘
- [Solved] Python Error: AttributeError: partially initialized module ‘keyword‘ has no attribute ‘kwlist‘
- How to Solve Python AttributeError: ‘module’ object has no attribute ‘xxx’
- Python3.6 Run uvicorn Error: AttributeError: module ‘asyncio‘ has no attribute ‘run‘
- AttributeError: module ‘time‘ has no attribute ‘clock‘ [How to Solve]
- [How to Solve]AttributeError: module ‘scipy’ has no attribute ‘io’
- [Solved] AttributeError: module ‘setuptools._distutils‘ has no attribute ‘version‘
- AttributeError: module ‘enum‘ has no attribute ‘IntFlag‘ [How to Solve]
- [Solved]AttributeError: module ‘urllib’ has no attribute ‘quote’
- [Solved] AttributeError: module ‘time‘ has no attribute ‘clock‘
- [Solved] AttributeError: module ‘distutils‘ has no attribute ‘version‘
- [Solved] Python Keras Error: AttributeError: ‘Sequential‘ object has no attribute ‘predict_classes‘
- [Solved] AttributeError: partially initialized module ‘xlwings’ has no attribute ‘App’
- [Solved] AttributeError: module ‘selenium.webdriver‘ has no attribute ‘Chrome‘
- [Solved] AttributeError: module ‘logging‘ has no attribute ‘Handler‘
- [Solved] AttributeError: module ‘tensorboard.summary._tf.summary‘ has no attribute ‘merge‘