module ‘tensorflow’ has no attribute 'get_default_graph’
当使用keras和tensorflow做深度学习的时候,python3.7报了这个错误
如何不降低版本,能成功进行训练
Please try:
# library to create sequential models
from tensorflow.keras.models import Sequential
# support for used layers
from tensorflow.keras.layers import Conv2D, MaxPooling2D, BatchNormalization, Flatten, Dense, Dropout, Activation, GlobalMaxPooling2D
# used optimizer
from tensorflow.keras.optimizers import Adam
instead of
# library to create sequential models
from keras.models import Sequential
# support for used layers
from keras.layers import Conv2D, MaxPooling2D, BatchNormalization, Flatten, Dense, Dropout, Activation, GlobalMaxPooling2D
# used optimizer
from keras.optimizers import Adam