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
本文介绍在使用Keras和TensorFlow 3.7时遇到的'get_default_graph()'属性缺失问题,提供不降低版本的解决方案,包括更新导入方式和推荐的库版本。通过替换库导入和选择合适的模型构建方法,帮助开发者顺利进行深度学习训练。
3882

被折叠的 条评论
为什么被折叠?



