Skip to content

Use eval mode during validation #7

@wutongshenqiu

Description

@wutongshenqiu

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions