asteroid-team / asteroid

The PyTorch-based audio source separation toolkit for researchers
https://asteroid-team.github.io/
MIT License
2.29k stars 423 forks source link

Missing model.eval() in eval.py scripts #643

Closed stachu86 closed 2 years ago

stachu86 commented 2 years ago

In all of the eval.py scripts in egs there are only calls to torch.no_grad().__enter__() and I believe there should be also a model.eval() call. I know that for the most cases there will be no difference, but for example in egs/whamr/TasNet/local/conf.yml there is dropout=0.3, so it can matter, and the more important thing is that, it can lead to new bugs and strange behavior when eval.py is reused with new models (I had this problem).

mpariente commented 2 years ago

On this line, in the function that loads the best model, .eval() is called, so the model is in the right mode.

But you're right that it should be visible in the eval script to be more understanding and easier to review.