I am doing transfer learning with vgg16.
Trying to include the state_dict using
vgg16.load_state_dict(torch.load("…/input/vgg16bn/vgg16_bn.pth"))
results in FileNotFoundError: [Errno 2] No such file or directory: ‘…/input/vgg16bn/vgg16_bn.pth’
Haven’t found the path to this file or a place to download it from the internet.
Thanks,
Uri
Are you sure the passed path is right, e.g. you are using three dots at the beginning, while you might wanted to use two?
I am using only two dots.
Thanks
Are you looking for a way to download the vgg16_bn
pretrained weights? Or just to load them? To download them, you could use
from torchvision import models
vgg16 = models.vgg16_bn(pretrained=True)
which will create a VGG16
network with batch-normalization and pretrained weights, saving the pretrained weights to $TORCH_HOME/checkpoints
on your system.