I got this error, and I don’t know the reason, honestly I got confuced with this exercise and need hints because the instructions to write the code are fuzzy for one who have no experience with TensorFlow!
You have used a different Layer function than they asked you to use in the instructions and comments. GlobalAveragePooling2D is not the same thing as AveragePooling2D. Please read the documentation that I linked under those two function names. Then the next thing that is different is the shape of the input. That probably indicates some problem with the functions you used in the previous layer.
Thanks,
The problem was that I have not used “global average pooling”, I solved the problem now