在测试集上验证时经常会有这么一句话:
model.eval()
这句话的作用是使得model 处于评价模式。
Sets the module in evaluation mode.
This has any effect only on certain modules. See documentations of particular modules for details of their behaviors in training/evaluation mode, if they are affected, e.g. Dropout
, BatchNorm
, etc.
This is equivalent with self.train(False)
.
Returns
self
Return type