Need some help! Week 1 Assignment 2 Exercise 2

I am sure that my code is correct but i’m still getting an value error saying Input 0 of layer max_pooling2d_2 is incompatible with the layer: expected ndim=4, found ndim=5. Full shape received: [1, None, 64, 64, 8]. Please help me as early as possible.

If you are sure your code is correct, then what help do you need?

1 Like

I’m getting the error in dimension during MaxPooling in first layer. I don’t know why. I thought maybe there was some error in my code but every time i tried, it shows the same error. Please, help!

Be sure that when you edit a cell that has a function, that you re-run that cell before you run its test. Cells are not automatically updated when you edit them - you have to run the cell with “shift-Enter”, for example.

1 Like

You can see the error in the exception trace that you show: you are putting commas on the ends of the lines. Remember that we’re doing the Functional API here, not the Sequential API. You need the commas for the Sequential API, but they are a disaster in the Functional API because they convert the RHS output to a tuple. That adds another dimension, which is why it throws that dimension mismatch error.

1 Like