Following guide at https://pytorch.org/mobile/android/ 4.
Try to generate model with script provided
import torch
import torchvision

model = torchvision.models.resnet18(pretrained=True)
model.eval()
example = torch.rand(1, 3, 224, 224)
traced_script_module = torch.jit.trace(model, example)
traced_script_module.save("app/src/main/assets/model.pt")

after that
build android app from https://github.com/pytorch/android-demo-app/tree/master/HelloWorldApp 8
and got error "Attempted to read a PyTorch file with version 3, but the maximum supported version for reading is 2"
my python package version
>>> import torch
>>> import torchvision
>>> print(torch.__version__)
1.6.0
>>> print(torchvision.__version__)
0.7.0
>>>