Justinus Hermawan
Justinus Hermawan

Reputation: 1214

Keras Error on Convolutional Layer and Input Data

I filtered the training and testing data from CIFAR-100, I take for fruit and vegetables superclass only. Now, I've 2,500 training and 500 testing data. But, I got an error said that wrong dimension input for Convolutional layer.

Error

My array data form: Array form

I hope someone can help me for this case, thank you.

Upvotes: 0

Views: 64

Answers (1)

Dr. Snoopy
Dr. Snoopy

Reputation: 56347

Your input data should have shape (2500, 3, 32, 32), seems you lost two of the dimensions on your preprocessing steps, either fix those or reshape your data as:

inputData = inputData.reshape((2500, 3, 32, 32)).

In general the input for a convolutional layer is (numSamples, numChannels, width, height). Note that when using the tensorflow backend the number of channels dimension goes at the end.

Upvotes: 1

Related Questions