C2W4 (None,1) and (None, 26) Error

During the assignment, I faced with problems, at create_model() part

So empirically, I found the solution to put input_shape=(28, 28, 1) in all Conv2D layers, but I dont really understand everything behind this solution.

When we use input_shape=(x, y, z) at first Conv2D- we show the height, width and color cheme,
But after first Conv2D +MaxPooling2D - the pixel size should become (26,26) isn’t it?

And why does the model can’t understand the input shape after first Conv2d + Pooling layer?

If you notice the image which is actually a matrix of numbers as you move on into the model deeper it gets converted into a different matrix of numbers with different size than the input matrix (it goes through transformations).

So its not possible to just use any matrix to enter into the model it needs its predifined input matrix.

1 Like