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 have Dropout layers.
Wrapping validation part with with torch.no_grad() may save time and memory.
Hi, thanks for the useful project written in pytorch. When looking into the code, I found that some places could be optimized:
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.with torch.no_grad()
may save time and memory.