Skip to content

Instantly share code, notes, and snippets.

@omarsar
Created August 24, 2019 18:02
Show Gist options
  • Save omarsar/1d57512aa974cb2c9f2cb083ea2d34ab to your computer and use it in GitHub Desktop.
Save omarsar/1d57512aa974cb2c9f2cb083ea2d34ab to your computer and use it in GitHub Desktop.
test_acc = 0.0
for i, (images, labels) in enumerate(testloader, 0):
images = images.to(device)
labels = labels.to(device)
outputs = model(images)
test_acc += get_accuracy(outputs, labels, BATCH_SIZE)
print('Test Accuracy: %.2f'%( test_acc/i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment