Use eval mode during validation
Opened this issue · 1 comments
wutongshenqiu commented
Hi, thanks for the useful project written in pytorch. When looking into the code, I found that some places could be optimized:
- 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 haveDropout
layers. - Wrapping validation part with
with torch.no_grad()
may save time and memory.
as791 commented
Hi I will check this @wutongshenqiu . Thank you for this info.