Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading model with low accuracy #2

Closed
posenhuang opened this issue Jun 28, 2017 · 3 comments
Closed

Loading model with low accuracy #2

posenhuang opened this issue Jun 28, 2017 · 3 comments

Comments

@posenhuang
Copy link

posenhuang commented Jun 28, 2017

Hi!
I found that when I load the model back using autoencoder.load_state_dict(torch.load(ae_path)) etc., it leads to low accuracy (around 0.3) even though the model achieves around 0.8 accuracy in evaluate_autoencoder during training.
I have to use torch.load(ae_path) and torch.save(autoencoder, f) to get away this problem.
Probably it is a pytorch bug, as discussed here: https://discuss.pytorch.org/t/saving-and-loading-a-model-in-pytorch/2610/6

@thvasilo
Copy link

@posenhuang Did you do model.eval() after loading the model to disable dropout?

@posenhuang
Copy link
Author

Yes, I did, but it it still the same. I'll double check again.

@lan2720
Copy link

lan2720 commented Aug 4, 2017

@posenhuang I met the similar problem. Did you solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants