I’m not sure what exactly is causing the error (I can reproduce it), so would recommend to create an issue in the torchvision repository. As a workaround you could torch.jit.script the model, which should work.