Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using 2.0.0 train model, but update transformers and sbert, can't load model by: SentenceTransformer(model_path) #1720

Open
rollmark opened this issue Oct 10, 2022 · 0 comments

Comments

@rollmark
Copy link

OSError: Error no file named pytorch_model.bin, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory ............

I need move pytorch_model.bin file from 2_Dense directory to out director, then it work, but a lots of warning like:
ome weights of the model checkpoint at /model_path/ were not used when initializing DistilBertModel: ['linear.bias', 'linear.weight']

  • This IS expected if you are initializing DistilBertModel 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 DistilBertModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
    Some weights of DistilBertModel were not initialized from the model checkpoint at /Users/mark.qin/derbysoft-ai-mapping/model_hubs/train_models/training_MultipleNegativesRankingLoss-latest/ and are newly initialized: ['transformer.layer.2.ffn.lin2.weight', 'transformer.layer.2.attention.out_lin.weight', 'transformer.layer.4.output_layer_norm.weight', 'transformer.layer.3.attention.k_lin.weight', 'transformer.layer.3.attention.v_lin.weight', 'transformer.layer.4.attention.out_lin.weight', 'transformer.layer.2.sa_layer_norm.bias', 'transformer.layer.4.sa_layer_norm.bias', 'embeddings.position_embeddings.weight', 'transformer.layer.1.attention.v_lin.bias', 'transformer.layer.1.ffn.lin1.bias', 'embeddings.LayerNorm.bias', 'transformer.layer.1.attention.q_lin.weight', 'transformer.layer.0.attention.q_lin.weight', 'transformer.layer.2.ffn.lin2.bias', 'transformer.layer.4.attention.out_lin.bias', 'transformer.layer.3.sa_layer_norm.weight', 'transformer.layer.5.output_layer_norm.bias', 'transformer.layer.3.sa_layer_norm.bias', 'embeddings.LayerNorm.weight', 'transformer.layer.5.attention.v_lin.weight', 'transformer.layer.5.attention.q_lin.weight', 'embeddings.word_embeddings.weight', 'transformer.layer.5.attention.out_lin.weight', 'transformer.layer.0.attention.k_lin.weight', 'transformer.layer.1.output_layer_norm.weight', 'transformer.layer.1.attention.out_lin.bias', 'transformer.layer.2.output_layer_norm.weight', 'transformer.layer.3.attention.out_lin.weight', 'transformer.layer.4.attention.q_lin.weight', 'transformer.layer.3.attention.k_lin.bias', 'transformer.layer.2.attention.q_lin.weight', 'transformer.layer.3.output_layer_norm.bias', 'transformer.layer.0.sa_layer_norm.weight', 'transformer.layer.2.attention.v_lin.bias', 'transformer.layer.5.attention.k_lin.weight', 'transformer.layer.5.attention.v_lin.bias', 'transformer.layer.3.ffn.lin2.weight', 'transformer.layer.5.attention.q_lin.bias', 'transformer.layer.3.attention.q_lin.weight', 'transformer.layer.5.ffn.lin1.bias', 'transformer.layer.0.attention.v_lin.bias', 'transformer.layer.2.ffn.lin1.bias', 'transformer.layer.4.ffn.lin2.weight', 'transformer.layer.2.output_layer_norm.bias', 'transformer.layer.4.attention.v_lin.bias', 'transformer.layer.2.attention.q_lin.bias', 'transformer.layer.4.ffn.lin2.bias', 'transformer.layer.4.attention.k_lin.weight', 'transformer.layer.1.attention.k_lin.bias', 'transformer.layer.0.ffn.lin1.bias', 'transformer.layer.3.output_layer_norm.weight', 'transformer.layer.3.ffn.lin1.weight', 'transformer.layer.0.attention.out_lin.bias', 'transformer.layer.1.attention.out_lin.weight', 'transformer.layer.4.attention.q_lin.bias', 'transformer.layer.2.attention.k_lin.bias', 'transformer.layer.5.ffn.lin1.weight', 'transformer.layer.5.sa_layer_norm.weight', 'transformer.layer.5.attention.k_lin.bias', 'transformer.layer.5.ffn.lin2.bias', 'transformer.layer.3.attention.v_lin.bias', 'transformer.layer.0.output_layer_norm.weight', 'transformer.layer.1.sa_layer_norm.bias', 'transformer.layer.1.attention.q_lin.bias', 'transformer.layer.0.attention.k_lin.bias', 'transformer.layer.1.ffn.lin2.bias', 'transformer.layer.2.attention.v_lin.weight', 'transformer.layer.1.attention.k_lin.weight', 'transformer.layer.5.attention.out_lin.bias', 'transformer.layer.0.attention.v_lin.weight', 'transformer.layer.5.ffn.lin2.weight', 'transformer.layer.1.attention.v_lin.weight', 'transformer.layer.2.attention.k_lin.weight', 'transformer.layer.2.ffn.lin1.weight', 'transformer.layer.0.ffn.lin2.bias', 'transformer.layer.1.sa_layer_norm.weight', 'transformer.layer.2.attention.out_lin.bias', 'transformer.layer.0.sa_layer_norm.bias', 'transformer.layer.1.output_layer_norm.bias', 'transformer.layer.3.ffn.lin2.bias', 'transformer.layer.4.attention.v_lin.weight', 'transformer.layer.4.sa_layer_norm.weight', 'transformer.layer.0.output_layer_norm.bias', 'transformer.layer.0.attention.q_lin.bias', 'transformer.layer.5.output_layer_norm.weight', 'transformer.layer.3.ffn.lin1.bias', 'transformer.layer.2.sa_layer_norm.weight', 'transformer.layer.4.attention.k_lin.bias', 'transformer.layer.0.ffn.lin2.weight', 'transformer.layer.0.ffn.lin1.weight', 'transformer.layer.4.ffn.lin1.weight', 'transformer.layer.1.ffn.lin2.weight', 'transformer.layer.3.attention.out_lin.bias', 'transformer.layer.3.attention.q_lin.bias', 'transformer.layer.4.ffn.lin1.bias', 'transformer.layer.4.output_layer_norm.bias', 'transformer.layer.5.sa_layer_norm.bias', 'transformer.layer.1.ffn.lin1.weight', 'transformer.layer.0.attention.out_lin.weight']
    You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.

my question: how to fix it that i don't need retrain my model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant