报错:
AttributeError: module ‘tensorflow’ has no attribute ‘get_default_graph’
解决方法:
例如你需要使用tf.keras,必须确保使用正确的导入
import tensorflow as tf
from tensorflow import keras
同样,在要使用keras下的其他模块时:
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import LSTM
参考文章:
https://blog.csdn.net/edward_zcl/article/details/103488191