Hi, the linear layer requires you to specify how many channels do you need as input and as output.
In your case the convolutional layers are wrong.
You need to set
self.conv1= nn.Conv2d(in_channels,out_channels,kernel_size)
Therefore the output of conv1 will have 5 channels which mismatch the input of conv2.
The fully connected layer (or linear layer)
requires as input
Linear(in_channels,out_channels)
In channels should match conv2’s out channels