Skip to content

Instantly share code, notes, and snippets.

@omarsar
Created August 31, 2019 14:24
Show Gist options
  • Save omarsar/eac75fb7db8def943997880dd5188909 to your computer and use it in GitHub Desktop.
Save omarsar/eac75fb7db8def943997880dd5188909 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