Solved by Ouasfi in post #2 
              
              
                Hello, 
I think the problem occurs during flattening… x.view(100, 100*12*12) only works with a batch of 100. 
class Net(nn.Module):
    def __init__(self):
        super(Net, self).__init__()
        self.conv1 = nn.Conv2d(3, 50, 5)
        self.pool1 = nn.MaxPool2d(2, 2)
        self.conv2 = nn.Con…