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

Use eval mode during validation #7

Open
wutongshenqiu opened this issue Dec 19, 2021 · 1 comment
Open

Use eval mode during validation #7

wutongshenqiu opened this issue Dec 19, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@wutongshenqiu
Copy link

wutongshenqiu commented Dec 19, 2021

Hi, thanks for the useful project written in pytorch. When looking into the code, I found that some places could be optimized:

  1. Use model.eval() during validation. According to the documentation of pytorch, Dropout behaves differently between 'train' and 'eval' mode. And both models used in cifar10 and mnist have Dropout layers.
  2. Wrapping validation part with with torch.no_grad() may save time and memory.
@as791
Copy link
Owner

as791 commented Dec 21, 2021

Hi I will check this @wutongshenqiu . Thank you for this info.

@as791 as791 added the enhancement New feature or request label Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants