2021
07-09
07-09
聊聊pytorch测试的时候为何要加上model.eval()
Doneedtousemodel.eval()whenItest?Sure,Dropoutworksasaregularizationforpreventingoverfittingduringtraining.ItrandomlyzerostheelementsofinputsinDropoutlayeronforwardcall.Itshouldbedisabledduringtestingsinceyoumaywanttousefullmodel(noelementismasked)使用PyTorch进行训练和测试时一定注意要把实例化的model指定train/eval,eval()时,框架会自动把BN和DropOut...
继续阅读 >