Here is your mistake. You copied the line but forgot to change the the second conv2 to conv3



 Janhawi:

    x = self.pool(F.relu(self.conv2(x)))

    x = self.pool(F.relu(self.conv2(x)))




def forward(self,x):

    #x = torch.randn(16, 3, 3, 3)

    x = self.pool(F.relu(self.conv1(x)))

    x = self.pool(F.relu(self.conv2(x)))

    x = self.pool(F.relu(self.conv2(x)))        # <--- HERE

    #flattern the image

    print(x.shape)

    x = x.view(-1,64*28*28)

    x = self.dropout(x)

    x = F.relu(self.fc1(x))

    x = self.dropout(x)

    x = F.relu(self.fc2(x))

    return x