gpt4 book ai didi

tensorflow - 属性错误 : 'Sequential' object has no attribute '_feed_input_names'

转载 作者:行者123 更新时间:2023-12-05 05:13:16 24 4
gpt4 key购买 nike

我正在关注 tf.keras tutorial使用 python 2.7.5 但 model.fit(data, labels, epochs=10, batch_size=32) 给我错误信息:

>>> model.fit(data, labels, epochs=10, batch_size=32,validation_data=    (val_data, val_labels))

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/software/TensorFlow/1.8-GPU-py2/lib/python2.7/site-packages/tensorflow/python/keras/_impl/keras/engine/training.py", line 1143, in fit
batch_size=batch_size)
File "/software/TensorFlow/1.8-GPU-py2/lib/python2.7/site-packages/tensorflow/python/keras/_impl/keras/engine/training.py", line 751, in _standardize_user_data
feed_input_names = self._feed_input_names
AttributeError: 'Sequential' object has no attribute '_feed_input_names'

谁能指出哪里不对?

最佳答案

我有同样的问题,不知道为什么,我没有搜索它但是当我添加这个参数时 input_shape=(height,width,channels) 我的第一层网络错误消失了。

model = keras.models.Sequential()
model.add(firstLayer(....., input_shape=(height,width,channels))

希望对你也有帮助。

关于tensorflow - 属性错误 : 'Sequential' object has no attribute '_feed_input_names' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53758374/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com