Files
graphene/Examples/pytorch/download-pretrained-model.py
Dayeol Lee e651c1d262 [Examples] Change PyTorch example to load model from a pickle file
- This example will be compared with another example for loading
encrypted models and inputs using PFS. Thus, load the model from a file.
- Updated Makefile and README.md
2020-06-03 12:11:27 -07:00

9 lines
232 B
Python

from torchvision import models
import torch
output_filename = "alexnet-pretrained.pt"
alexnet = models.alexnet(pretrained=True)
torch.save(alexnet, output_filename)
print("Pre-trained model was saved in \"%s\"" % output_filename)