"No sentence-transformers model found" error

#2
by Honeybread - opened

"
No sentence-transformers model found with name /Users/(myname)/.cache/torch/sentence_transformers/anferico_bert-for-patents. Creating a new one with MEAN pooling.
Some weights of the model checkpoint at /Users/(myname)/.cache/torch/sentence_transformers/anferico_bert-for-patents were not used when initializing BertModel: ['cls.predictions.transform.LayerNorm.weight', 'cls.predictions.decoder.bias', 'cls.predictions.decoder.weight', 'cls.predictions.transform.LayerNorm.bias', 'cls.seq_relationship.bias', 'cls.seq_relationship.weight', 'cls.predictions.transform.dense.bias', 'cls.predictions.transform.dense.weight', 'cls.predictions.bias']
This IS expected if you are initializing BertModel 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 BertModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
"

I am trying SBERT with many different other models, but such error occurred only with this model.
As other models are working fine without any errors, it is seems like my code or my data or my computer is not the source of the problem.

Can you please check why is this happening? This many also be the reason for recent decrease in downloading trend for this model.

Hi, this is actually expected as this model is a regular BERT, not a SBERT. Perhaps the other models you've used sentence-transformers with were SBERT models already, which is why you didn't get the error. In fact, it's not even an error: sentence-transformers simply states "Creating a new one with MEAN pooling.", but then doesn't throw any exception or anything.
Note that after a SBERT model is initialized this way (i.e. from a regular BERT), it must be trained on a text similarity task before you can use it for predictions.

If you still have doubts, please refer to the original SBERT paper.

Thank you, have a wonderful weekend :)

Has anyone done sbert training for this dataset?

Sign up or log in to comment