RunTimeError: Error(s) in loading state_dict for RobertaForSequenceClassification
See original GitHub issueI get the following error after trying to run
pip install -r requirements.txt
python -m detector.server detector-base.pt
Error:
RuntimeError: Error(s) in loading state_dict for RobertaForSequenceClassification:
Missing key(s) in state_dict: "roberta.embeddings.position_ids".
Unexpected key(s) in state_dict: "roberta.pooler.dense.weight", "roberta.pooler.dense.bias"
I’m not sure if there was a change between the google version of the Roberta weights or the azure version of the weights.
Thanks for the help!
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
python 3.x - Error(s) in loading state_dict for ... - Stack Overflow
I am writing my code for binary classification: bin RuntimeError: Error(s) in loading state_dict for RobertaForSequenceClassification: size ...
Read more >[Example code]-Error(s) in loading state_dict for ...
I am writing my code for binary classification: bin RuntimeError: Error(s) in loading state_dict for RobertaForSequenceClassification: size mismatch for ...
Read more >Problem in loading an old sentence classification roberta ...
Hello, I created a roberta sentence classifier model last year using the transformer version 3.0.2. Currently, I am trying to upgrade the ...
Read more >Unexpected key(s) in state_dict: “roberta.pooler.dense.weight“....
在加载已经训练好的模型时,出现问题如下:RuntimeError: Error(s) in loading state_dict for RobertaForSequenceClassification: Unexpected key(s) ...
Read more >Renaming model checkpoints can give an error - Reddit
format( RuntimeError: Error(s) in loading state_dict for LatentDiffusion: size mismatch for model.diffusion_model.input_blocks.0.0.weight: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you @jongwook ! Changing, in the
requirements.txt
, thetransformers>=2.0.0
totransformers==2.9.1
resolved the issue.Same thing today
With transformer 2.9.1.