AttributeError: module ‘tensorflow‘ has no attribute ‘get_default_graph‘

可以把原来的开头引用替换成这个

from tensorflow.python.keras.layers import Dense
from tensorflow.python.keras import Sequential

classifier = Sequential()
classifier.add(Dense(6, init = 'uniform', activation = 'relu', input_dim = 11))


你可能感兴趣的:(python自学,笔记,python)