The issue is that each layer’s input must be compatible with the previous layer’s output. For example, your first convolution has 32 output channels, but the second convolution expects just a single input channel. These numbers need to match.