Skip to content

Instantly share code, notes, and snippets.

@rafalpronko
Created February 11, 2019 05:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafalpronko/62ab23d5359395b8358b436425079508 to your computer and use it in GitHub Desktop.
Save rafalpronko/62ab23d5359395b8358b436425079508 to your computer and use it in GitHub Desktop.
correct = 0
total = 0
modelpy.eval()
for images, labels in test_loader:
outputs = modelpy(images)
_, predicted = torch.max(outputs.data, 1)
total += labels.size(0)
correct += (predicted == labels).sum()
print('Test Accuracy of the model on the {} test images: {}%'.format(total, 100 * correct / total))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment