3

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?

1
  • The types of errors I see when using tf.keras are very strange. I'd probably try to use the original keras. Commented Dec 13, 2018 at 11:29

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.