我正在写关于深度学习的硕士论文,可能对图书馆有问题
以下是错误:
AttributeError: module 'tensorflow.compat.v2' has no attribute '__internal__'
型号:
import tensorflow
from tensorflow import keras
from keras import models
from keras import layers
model = models.Sequential()
model.add(layers.Dense(32, input_shape=(784,)))
model.add(layers.Dense(32))
我认为问题在于您导入所需模块的方式。试着这样做:
如果你得到了你的网络摘要,这意味着一切都很好,否则可能会告诉我你没有正确安装Tensorflow
以下为总结,以供参考:
相关问题 更多 >
编程相关推荐