You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use the 'bert_ner_model' and 'bert_tone_model' using the "load_bert_tone_ner" and "load_bert_tone_model" methods.
I get the following errors when loading the models:
NER:
RuntimeError: Error(s) in loading state_dict for BertForTokenClassification:
size mismatch for classifier.weight: copying a param with shape torch.Size([9, 768]) from checkpoint, the shape in current model is torch.Size([2, 768]).
size mismatch for classifier.bias: copying a param with shape torch.Size([9]) from checkpoint, the shape in current model is torch.Size([2]).
Tone:
RuntimeError: Error(s) in loading state_dict for BertForSequenceClassification:
size mismatch for classifier.weight: copying a param with shape torch.Size([3, 768]) from checkpoint, the shape in current model is torch.Size([2, 768]).
size mismatch for classifier.bias: copying a param with shape torch.Size([3]) from checkpoint, the shape in current model is torch.Size([2]).
Any ideas on how to fix this?
Final note:
Thanks for your work on Danish NLP! You are really advancing the field with this repo.
The text was updated successfully, but these errors were encountered:
Hi mathiasGM,
What is your environment? The code is tested with danlp==0.0.9, and transformers==2.3.0 - perhaps try to install from source. Let me know if this help, or else please list your environment.
Thanks, we are glad that you like our work.
Amalie
Hi,
I am trying to use the 'bert_ner_model' and 'bert_tone_model' using the "load_bert_tone_ner" and "load_bert_tone_model" methods.
I get the following errors when loading the models:
NER:
RuntimeError: Error(s) in loading state_dict for BertForTokenClassification:
size mismatch for classifier.weight: copying a param with shape torch.Size([9, 768]) from checkpoint, the shape in current model is torch.Size([2, 768]).
size mismatch for classifier.bias: copying a param with shape torch.Size([9]) from checkpoint, the shape in current model is torch.Size([2]).
Tone:
RuntimeError: Error(s) in loading state_dict for BertForSequenceClassification:
size mismatch for classifier.weight: copying a param with shape torch.Size([3, 768]) from checkpoint, the shape in current model is torch.Size([2, 768]).
size mismatch for classifier.bias: copying a param with shape torch.Size([3]) from checkpoint, the shape in current model is torch.Size([2]).
Any ideas on how to fix this?
Final note:
Thanks for your work on Danish NLP! You are really advancing the field with this repo.
The text was updated successfully, but these errors were encountered: