Hey there,
Your convolutional layers and pooling layers are reducing channel size so that you end up having 1x1 channels as the max pooling layer input.
It would probably help to manually track down the output size of your convolutional/pooling layers.
You could try printing output sizes and/or calculating how each layer affects your input’s dimensions to better understand this error and why it occurred.