Input dimension error

Hi i am getting the following error when i try to implement a classifier

I am unable to understand why this is happening

The input of a 2D Cons has to have 4 dimensions: NxCxHxW where N is the Batchsize, C is the Channel Size and H and W are the spatial image sizes.

From your screenshot it seems, that your input is of size (28, 28, 1) which is most likely (H, W, C). So at first you have to move the channel dimension to the front and then add another dimension to be the batch dim.

1 Like

Thank you very much
Can you tell me the syntax of conv2d as the syntax is unclear from the discription

I don’t know, what you mean by syntax.

So your reshape would probably be np.reshape(x, (1, 1, 28, 28)) if that’s what you were asking for.

1 Like

Oh i got that part.
Thank you very much for the help