I need to avoid downloading the model from the web (due to restrictions on the machine installed).
This works, but it downloads the model from the Internet
model = torch.hub.load('pytorch/vision:v0.9.0', 'deeplabv3_resnet101', pretrained=True)
I have placed the .pth
file and the hubconf.py
file in the /tmp/ folder and changed my code to
model = torch.hub.load('/tmp/', 'deeplabv3_resnet101', pretrained=True, source='local')
but to my surprise, it still downloads the model from the Internet. What am I doing wrong? How can I load the model locally?
Just to give you a bit more details, I'm doing all this in a Docker container that has a read-only volume at runtime, so that's why the download of new files fails.