asyml / texar-pytorch

Integrating the Best of TF into PyTorch, for Machine Learning, Natural Language Processing, and Text Generation. This is part of the CASL project: http://casl-project.ai/
https://asyml.io
Apache License 2.0
745 stars 117 forks source link

Switch between model.train() and model.eval() #310

Closed li3cmz closed 4 years ago

li3cmz commented 4 years ago

https://github.com/asyml/texar-pytorch/blob/95f3d644680656f38b7b1779f2ba184ef9e1f81a/examples/bert/bert_classifier_main.py#L164

Hello, I find that after doing "_eval_epoch()",you don't switch model.eval() to model.train(). Wouldn't that be a problem?

huzecong commented 4 years ago

Hmm, this is a very good point, thank you for your report. @gpengzhi @AvinashBukkittu Could you verify this and maybe rerun the experiments?