Tensorflow, keras를 사용할때 갑자기 keras.optimizer를 import할수 없다는 경우 해결법
[문제코드]
from keras.optimizers import Adam
[해결코드]
"from tensorflow.keras.optimizers import Adam"로 바꾸자!!
from tensorflow.keras.optimizers import Adam # - Works
from tensorflow.keras.optimizers import adam # - Does not work
from keras.optimizers import Adam # - Does not work
from keras.optimizers import adam # - Does not work
[참고]
'DeepLearning Framework & Coding > De-bugging' 카테고리의 다른 글
[Github] Google Colab파일 Github로 push하기 (2) | 2021.12.21 |
---|---|
[Tensorflow 2.0] TypeError: '(slice(None, None, None), slice(None, -1, None))' is an invalid key (0) | 2021.12.21 |
ModuleNotFoundError: No module named 'wrapt' (0) | 2021.06.28 |
ImportError: cannot import name 'moduleTNC' from partially initialized module 'scipy.optimize' (0) | 2021.06.28 |
Tensorflow2는 tf.contrib를 지원하지 않습니다. (0) | 2020.12.30 |
댓글