Sorry for making it not clear.
I mean the in_channels of conv2 are set currently to 6, although conv1 returns 32 channels.
So your model is currently not working.
Try the following and you’ll get an error for conv2:
model = LeNet()
x = torch.randn(1, 1, 96, 96)
output = model(x)
> RuntimeError: Given groups=1, weight of size [64, 6, 2, 2], expected input[1, 32, 47, 47] to have 6 channels, but got 32 channels instead

Also, after fixing this issue, you’ll get another size mismatch error for your fc1 layer, as the shape of x right before flattening it is [1, 128, 11, 11]. So fc1 should take in_featutres=128*11*11.
After fixing this issue, you’ll get another error as you are reusing fc3. Removing the x = F.relu(self.fc3(x)) line finally makes your model run.
I’m curious why the model seems to be working for you.