PyTorch Model zoo and pretrained models not loading in Colab

I am trying to load models from the model zoo in Google Colab and keep getting the errors:

AttributeError: module 'torch.jit' has no attribute 'unused'

I was trying to load and used the offical link to open in Colab yet getting this error. Even if I try to import any model from torchvision I get the same error. How do I fix this to use a pretrained model?

I tried somethings suggested elsewhere to update pytorch to nightly and the one on google colab is already nightly and 1.2.0 so I dont know what more to do.

@ptrblck @apaszke any suggestions?

Thanks for raising this issue!
It seems the currently linked model cannot be imported using the latest stable release (1.2.0).
However, after installing the nightly build, the model was loaded successfully in my colab notebook.
Try to run the following lines:

!pip uninstall torch -y
!pip install --pre torch torchvision -f
# Restart of runtime might be necessary 
import torch
model = torch.hub.load('pytorch/vision', 'deeplabv3_resnet101', pretrained=True)

Thanks! It worked. When will we see more models? Segmentation has only 2!

Good to hear it’s working!
I’m not sure which models are currently being developed, but if you are missing some important model, we might assist you in contributing it to the hub. :slight_smile: