Hi, Can somebody please explain this error and how to rectify it?
Hi @Syed_Hamza_Tehseen , based on the error message, the input tensor being passed to the max_pooling2d_7
layer has 5 dimensions instead of the expected 4. The expected input shape for max_pooling2d_7
is (batch_size, height, width, channels), but it seems that the actual shape received is (batch_size, seq_length, height, width, channels).
Keep learning!
Right, as Carlos points out, there is an inconsistency in how your model is constructed. You’ll have to go back and find the appropriate layer and figure out why the previous layer is emitting the wrong shape. Printing the summary of the model may be a good way to navigate to the appropriate point:
model.summary()
That will give you descriptions of all the layers in order with the output shapes. Using that, you should be able to find the incorrect layer to examine.