cabe
cabe

Reputation: 115

AttributeError: 'Sequential' object has no attribute '_feed_input_names'

I'm following the tf.keras tutorial with python 2.7.5 but model.fit(data, labels, epochs=10, batch_size=32) gives me the error message:

>>> 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'

Can anyone point out what is wrong?

Upvotes: 3

Views: 8610

Answers (1)

leo
leo

Reputation: 820

I had the same issue ,not sure why, I did not search about it but when I added this argumant input_shape=(height,width,channels) to my first layer of network the error went away.

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

I hope it helps you too.

Upvotes: 2

Related Questions