import 报错:cannot import name ‘get_config‘ from ‘tensorflow.python.eager.context‘

from keras.layers import Dense,Dropout,Activation,Convolution2D,MaxPooling2D,Flatten
from keras.layers import LSTM

报错:

ImportError: cannot import name 'get_config' from 'tensorflow.python.eager.context' (C:\Users\xx\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\eager\context.py)
将代码修改为:

from tensorflow.keras.layers import Dense,Dropout,Activation,Convolution2D,MaxPooling2D,Flatten
from tensorflow.keras.layers import LSTM

你可能感兴趣的:(python,Deep,Learning,tensorflow,python,keras)