#from torchvision.models import inception_v3
device = torch.device('cpu')

model = models.resnet50(pretrained=True)
model.load_state_dict(models.resnet50(pretrained=True).state_dict())
model = nn.Sequential(
    #ImageScale(),
    model,
    nn.Softmax(1)
)
model.eval()
input_tensor = torch.rand(1,3,224,224)
script_model = torch.jit.trace(model, input_tensor)
script_model.save("models/resnet50.pt")

Just for reference this is how I’m saving my model before taking it into iOS. Worked perfectly for resnet34 and resnet18