model serialization code changed

This commit is contained in:
yunjey
2017-03-18 16:28:19 +09:00
parent 6c74dfab60
commit 3a7a9cf07b
16 changed files with 41 additions and 37 deletions

View File

@ -90,4 +90,4 @@ for images, labels in test_loader:
print('Test Accuracy of the model on the 10000 test images: %d %%' % (100 * correct / total))
# Save the Trained Model
torch.save(cnn, 'cnn.pkl')
torch.save(cnn.state_dict(), 'cnn.pkl')

View File

@ -90,4 +90,4 @@ for images, labels in test_loader:
print('Test Accuracy of the model on the 10000 test images: %d %%' % (100 * correct / total))
# Save the Trained Model
torch.save(cnn, 'cnn.pkl')
torch.save(cnn.state_dict(), 'cnn.pkl')