What am I missing when using the new pretrained weight initialization

I have attempted at least 10x to put up with the bad habit of using pretrained=True in the past but every time I tried to pass the string weights="IMAGENET1K_V2" I get the

return cls._member_map_[name]
KeyError: 'IMAGENET1K_V2'

I must be missing something, should I expect this syntax to work?

resnet50(weights="IMAGENET1K_V2") works for me using torchvision==0.15.1+cu118.

I found the bug, for some reason in the slurm instance the right pytorch but the wrong torchvision was linked! my bad :slight_smile: thanks!