Hi,
Actually, the error is happening in this line.



 Hbert16:

            nn.Conv2d(3, 32, 4, 2, 0),
…
x = self.conv1(x)


The issue is that when you are loading your images using for loop on train_loader it returns tensors of size [batch_size, 1, height, width] and your first convolution layer is nn.Conv2d(3, 32, ...) which expects 3 channels not 1.
Probably your images are grayscale so they have 1 channel. Changing conv1 of model to below can solve:
nn.Conv2d(1, 32, 4, 2, 0),

Bests