sc_depth_pl
sc_depth_pl copied to clipboard
AttributeError: module 'torchvision.models.resnet' has no attribute 'model_urls'
As of torchvision version 0.15.0 the 'resnet' module no longer contains the attribute 'model_urls' referenced in resnet_encoder.py.
This error was fixed by downgrading my torchvision to 0.14.1, but anyone trying to run this script should be aware that the latest versions of torchvision will no longer work.
I have the same issue on torchvision 0.15.0. Here is how I solve the problem:
If you are using resnet18 for example, you can replace the original code like
loaded = torch.hub.load_state_dict_from_url(models.ResNet18_Weights.IMAGENET1K_V1.url)
in resnet_encoder.py
The url is embedded in resnet weight object.