Some weights of the model checkpoint at roberta-large-mnli were not used

#7
by tomhosking - opened

Loading the model using the recommended approach results in the error "Some weights of the model checkpoint at roberta-large-mnli were not used":

from transformers import  AutoModelForSequenceClassification
model = AutoModelForSequenceClassification.from_pretrained("roberta-large-mnli")
Some weights of the model checkpoint at roberta-large-mnli were not used when initializing RobertaForSequenceClassification: ['roberta.pooler.dense.bias', 'roberta.pooler.dense.weight']
- This IS expected if you are initializing RobertaForSequenceClassification from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
- This IS NOT expected if you are initializing RobertaForSequenceClassification from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).

Should a different model be used to load this checkpoint? Or can the weights be safely removed from the checkpoint?

Tested on transformers==4.36.2

Hi @tomhosking

You can ignore this warning. Everything is fine for using this checkpoint for sequence classification`task.

OK, thanks! Is there a way to disable the error message?

Hi @tomhosking

There is currently no way to disable the warning just for this combination model/checkpoint.

(we didn't have this warning several months back but a merged PR make this appear)

Sign up or log in to comment