filipefborba/HandRecognition

Convolution error

Closed this issue · 2 comments

While training your model, I am getting this error:

ValueError: Error when checking input: expected conv2d_5_input to have 4 dimensions, but got array with shape (14000, 120, 320)

For this code:
model.fit(X_train, y_train, epochs=5, batch_size=64, verbose=2, validation_data=(X_test, y_test))

Just ran everything without errors, just deprecation warnings in the Google Colab environment. It seems that your "X" array has a different shape than the Conv2D layer input shape. You need to use numpy.reshape to match those two.

  • I'm guessing that you're not using the same dataset, right?
  • Did you use Google Colab? (This helps a lot, because we can minimize environment issues)
  • Did you change the code?
  • What versions of Keras/Tensorflow are you using?

Please, send more infos about your project so I can help you out! =)

  • I am using Tensorflow version 1.13.1

  • I am using Jupyter notebook for training the same kaggle dataset.

  • I resolved the issue using reshaping. Thank you.

Your work is great.