2024-10-04 03:25:05 发布
网友
我得到这个错误
AttributeError: type object 'TypeSpecProto' has no attribute 'NDARRAY_SPEC'
screenshot
对我来说,解决这个问题的唯一方法是卸载tensorflow tensorboard和numpy软件包,然后通过pip执行以下操作重新安装它们:
pip uninstall numpy tensorflow tensorboard pip install user upgrade tensorflow
原因是tensorflow版本与python版本不兼容
有关兼容版本的了解,请参阅this page
您需要将导入移动到tensorflow.keras域。例如:
tensorflow.keras
from tensorflow.keras.models import Sequential, Model from tensorflow.keras.layers import Dense, Activation, concatenate, Input, Embedding from tensorflow.keras.layers import Reshape, Concatenate, BatchNormalization, Dropout, Add, Lambda from tensorflow.keras.layers import add from tensorflow.keras.optimizers import Adam, RMSprop from tensorflow.keras.wrappers.scikit_learn import KerasClassifier, KerasRegressor
对我来说,解决这个问题的唯一方法是卸载tensorflow tensorboard和numpy软件包,然后通过pip执行以下操作重新安装它们:
原因是tensorflow版本与python版本不兼容
有关兼容版本的了解,请参阅this page
您需要将导入移动到
tensorflow.keras
域。例如:相关问题 更多 >
编程相关推荐