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.

OSError: Unable to load weights from pytorch checkpoint file.

See original GitHub issue

Hello,

When I am trying to load the Roberta-large pre-trained model, I get the following error:

model_RobertaForMultipleChoice = RobertaForMultipleChoice.from_pretrained('roberta-large', output_hidden_states = True)

OUT:
OSError: Unable to load weights from pytorch checkpoint file. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True. 

How can I solve this issue? Thank you,

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Freed-Wucommented, May 21, 2021

Same as https://github.com/huggingface/transformers/issues/6620, i guess it is because the checkpoint file is not a true checkpoint file: such as a git lfs file.

1reaction
LysandreJikcommented, Jan 4, 2021

Please open a new issue with your specific problem, alongside all the information related to your environment as asked in the template. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to load weights from pytorch checkpoint file #4336
You can only torch.load from a file that is seekable. Please pre-load the data into a buffer like io.BytesIO and try to load...
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 >
Unable to load weights from pytorch checkpoint after splitting ...
bin of a pretrained deeppavlov ruBERT model but I have a file size limit. So I split it into chunks using python, transferred...
Read more >
Help Set tf=True? - PyTorch Forums
OSError : Unable to load weights from pytorch checkpoint file for 'EleutherAI/gpt-neo-2.7B' at 'C:\Users\USER7/.cache\huggingface\transformers\ ...
Read more >
First run fails : r/StableDiffusion - Reddit
Looks like it can't find this path: "Error: Unable to load weights from pytorch checkpoint file for 'C:\Users\zirni/.cache\huggingface\ ...
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