Loading resnet50 prettrianed model in PyTorch
Question:
Answers:
As per the latest definition, we now load models using torchvision library, you can try that using:
from torchvision.models import resnet50, ResNet50_Weights
# Old weights with accuracy 76.130%
model1 = resnet50(weights=ResNet50_Weights.IMAGENET1K_V1)
# New weights with accuracy 80.858%
model2 = resnet50(weights=ResNet50_Weights.IMAGENET1K_V2)
As per the latest definition, we now load models using torchvision library, you can try that using:
from torchvision.models import resnet50, ResNet50_Weights
# Old weights with accuracy 76.130%
model1 = resnet50(weights=ResNet50_Weights.IMAGENET1K_V1)
# New weights with accuracy 80.858%
model2 = resnet50(weights=ResNet50_Weights.IMAGENET1K_V2)