↓폴밍끼 유튜브 채널 자세히보기

Python library & package/Tensorflow & keras

(해결방법) cannot import name 'get_config' from 'tensorflow.python.eager.context'

폴밍끼 2021. 7. 23. 22:18
728x90

저 같은 경우도 텐서플로를 2.2.0에서 2.4.1로 업데이트 후 이런 에러가 떴었는데 아래 방법 참고해서 해결하였습니다. keras에서 load_model 하지 않고 아래 코드대로 load_model하니까 해결됐어요! 오 주여!!!! 감사합니다 ㅠㅠㅠ

I had Tensorflow===2.2.0 and when I updated it to Tensorflow==2.4.0 this issue occurred.

I think there is a conflict of keras.models.load_model and the base version of tensorflow you are using.

Try running -

import tensorflow as tf
tf.keras.models.load_model(model_path)

It worked for me.

https://stackoverflow.com/questions/66964492/importerror-cannot-import-name-get-config-from-tensorflow-python-eager-conte/67618073#67618073?newreg=ae34de71423b4d40854427f6aef576d4 

 

ImportError: cannot import name 'get_config' from 'tensorflow.python.eager.context'

My notebook was working up till today. At the beginning of my colab notebook I install tf-nightly, but now it is giving me this error ---------------------------------------------------------------...

stackoverflow.com