Solved by Brando_Miranda in post #11 
              
              
                I think the simplest answer is the one from the cifar10 tutorial: 
total = 0
with torch.no_grad():
    net.eval()
    for data in testloader:
        images, labels = data
        outputs = net(images)
        _, predicted = torch.max(outputs.data, 1)
        total += labels.size(0)
        correct …