Hello!
I tried using sismetanin/xlm_roberta_base-ru-sentiment-rusentiment
model for binary classification by setting num_labels=2
.
model = AutoModelForSequenceClassification.from_pretrained("sismetanin/xlm_roberta_base-ru-sentiment-rusentiment", num_labels=2, output_attentions=False)
The model has 5 outputs, so the following error was displayed:
RuntimeError: Error(s) in loading state_dict for XLMRobertaForSequenceClassification:
size mismatch for classifier.out_proj.weight: copying a param with shape torch.Size([5, 768]) from checkpoint, the shape in current model is torch.Size([2, 768]).
size mismatch for classifier.out_proj.bias: copying a param with shape torch.Size([5]) from checkpoint, the shape in current model is torch.Size([2]).
How do I change the number of output neurone?
Thanks in advance!