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

Why not use torch.no_grad when evaluating test data? #92

Open
EvanZ opened this issue Jul 3, 2021 · 1 comment
Open

Why not use torch.no_grad when evaluating test data? #92

EvanZ opened this issue Jul 3, 2021 · 1 comment

Comments

@EvanZ
Copy link

EvanZ commented Jul 3, 2021

The way the trainer is set up the iteration that is used for train and test is similar except when train step is run the backwards propagation occurs. But one other thing I typically see different between test and train is that in the test batch with torch.no_grad() is used so that, for example, dropout is not applied. Was there any reason this isn't used here?

@Guo-Stone
Copy link

I think it should use torch.no_grad(). Or it will run out of GPU memory.

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

2 participants