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.

Manual download of a pytorch_model.bin results in a zip file

See original GitHub issue

I’m behind a firewall so that I cannot download models from a python script. However, I am able to download files directly from the hub, for example here https://huggingface.co/facebook/wav2vec2-base-100h. The probleme I have is that the download of the pytorch_model.bin file results in a .zip file. I dont know what to do with this zip file and its content does not help either. I tried to simply rename it to pytorch_model.bin but of course I got errors when loading this pre_trained model.

So my question is how to download models and use them offline afterwards ?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
LysandreJikcommented, Sep 16, 2021

Ah it’s very possible that model only works with more recent versions of PyTorch indeed. We should do a better job of documenting which models are compatible with which version (which is on the roadmap).

Is there something blocking you from updating to a more recent version of PyTorch?

1reaction
LysandreJikcommented, Sep 16, 2021

You could do the conversion by loading the model in PyTorch v1.6.0, saving it using the old serialization system, and then loading it in 1.1.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

pytorch_model.bin is a zip archive (did you mean to use torch ...
pytorch_model.bin is a zip archive (did you mean to use ... I need to first download models locally and then upload all the...
Read more >
Saving and Loading Models - PyTorch
Saving and Loading Models. Author: Matthew Inkawhich. This document provides solutions to a variety of use cases regarding the saving and loading of...
Read more >
OSError: Unable to load weights from pytorch checkpoint file
Hi, everyone. I need some help. I have been developing the Flask website that has embedded one of Transformer's fine-tuned models within it....
Read more >
09. PyTorch Model Deployment - Zero to Mastery Learn ...
9.2 Running our FoodVision Mini demo locally¶. If you download the foodvision_mini.zip file, you can test it locally by: Unzipping the file. Opening...
Read more >
How do I save a trained model in PyTorch? - Stack Overflow
The PyTorch model is torch.nn. ... A common PyTorch convention is to save models using either a .pt or .pth file extension.
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