Pytorch中的 model.train() 和 model.eval() 模式

Posted sbj123456789

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Pytorch中的 model.train() 和 model.eval() 模式相关的知识,希望对你有一定的参考价值。

model.train() :启用 BatchNormalization 和 Dropout

model.eval() :不启用 BatchNormalization 和 Dropout

 

参考:

https://pytorch.org/docs/stable/nn.html?highlight=module%20eval#torch.nn.Module.eval

以上是关于Pytorch中的 model.train() 和 model.eval() 模式的主要内容,如果未能解决你的问题,请参考以下文章