We Are Going To Discuss About ImportError: cannot import name ‘get_config’ from ‘tensorflow.python.eager.context’. So lets Start this Python Article.
ImportError: cannot import name ‘get_config’ from ‘tensorflow.python.eager.context’
- How to solve ImportError: cannot import name 'get_config' from 'tensorflow.python.eager.context'
Instead of:
import keras
Try:from tensorflow import keras
- ImportError: cannot import name 'get_config' from 'tensorflow.python.eager.context'
Instead of:
import keras
Try:from tensorflow import keras
Solution 1
Instead of:
import keras
Try:
from tensorflow import keras
Original Author Anusha Of This Content
Solution 2
These commands fixed the issue:
pip install --upgrade tensorflow
pip install --upgrade tensorflow-gpu
Original Author thomle295 Of This Content
Solution 3
Try the version of Keras 2.3.1
pip install keras==2.3.1
then also install that
pip install git+https://www.github.com/keras-team/keras-contrib.git
Original Author MD Gazuruddin Of This Content
Solution 4
instead of
from keras.preprocessing import image
do this:
from tensorflow.keras.preprocessing import image
Original Author bart-khalid Of This Content
Conclusion
So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.