PyTorch · Method
model.eval
model.eval() switches a TorchVision model to evaluation mode. Use it before inference so layers with different training and evaluation behavior use their inference behavior.
Last updated
Syntax
model.eval()In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
model.train()weights.transforms()ResNet50_Weightsresnet50