question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loading weights from TorchVision will stop working

See original GitHub issue

Hi OpenMMLab team, Thanks for your awesome work on MMCV.

The current implementation of get_torchvision_models() is trying to access the model_urls variable that existed in some backbone implementations of TorchVision. TorchVision considers this variable non-public (because it’s not included in the __all__) and non-standard (because it’s not available in all models) and thus plans to remove it on the next version. We are currently moving on a new API that will allow us to support multiple pretrained weights for every model variant (read more here). This change has recently landed at TorchVision on https://github.com/pytorch/vision/pull/5618.

To avoid breakages, we recommend to update your code. A few options include to:

  1. Access the URLs from the new public locations
  2. Move the the model_urls maps on your side
  3. Something else, happy to work with you to figure it out

We intentionally released this change several months before the next release to give time to iron out issues like that. Let me know your thoughts on how we should go about it. Thanks!

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:4
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
zhouzaidacommented, Apr 16, 2022

Hi @datumbox , thanks for your awesome work on torchvision. We are trying to handle these changes and we want to know when will the new version v0.13 be released?

0reactions
zhouzaidacommented, Apr 19, 2022

@zhouzaida Apologies for the delay getting back to you. I was OOO.

We don’t have a fixed date yet but we expect it to be around end of June or beginning of July.

Got it. Thanks for your reply.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pytorch loading saved weights but not working - Stack Overflow
But when I load the weights the loss value starts from the initial loss value which means the loading is failing somehow. net...
Read more >
Weights loaded incorrectly - vision - PyTorch Forums
Can someone point out my error, because I tried it on other models, and it seemed to work? import vgg16 pretrained_weights = torch.load(os.path....
Read more >
Saving and Loading Models — PyTorch Tutorials 1.0.0 ...
In PyTorch, the learnable parameters (i.e. weights and biases) of an torch.nn ... The reason for this is because pickle does not save...
Read more >
load weights into model torch without torch.load - You.com
In an environment without torchvision, I rebuilt the model by inspecting the torchvision.models.vgg code. Then I loaded this state_dict file into the state_dict ......
Read more >
How to Save and Load Models in PyTorch - Wandb
This article is a tutorial that covers how to correctly save and load your trained machine learning models in PyTorch using Weights &...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found