Describe the bug
I am following the instructions in the tutorial
https://github.com/deepset-ai/haystack/blob/master/tutorials/Tutorial6_Better_Retrieval_via_DPR.ipynb
When I try to execute the following lines :
from haystack.retriever.dense import DensePassageRetriever
retriever = DensePassageRetriever(document_store=document_store, embedding_model="dpr-bert-base-nq",
do_lower_case=True, use_gpu=True)
I get the following error
RuntimeError: Error(s) in loading state_dict for HFBertEncoder:
Missing key(s) in state_dict: "embeddings.position_ids".
File "/.local/lib/python3.6/site-packages/haystack/retriever/dense.py", line 191, in _prepare_model
model_to_load.load_state_dict(ctx_state)
File ".local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 847, in load_state_dict
self.__class__.__name__, "\n\t".join(error_msgs)))
Hey @mchari this seems like a version mismatch, since the notebook is able to load models. Check out our colab notebook.
So I guess you are using the notebook locally with a custom python environment.
What version of transformers do you have installed? We currently use transformers==3.0.2
@Timoeller , thanks for your reply.
i re-installed transformers and haystack and I am past the error now.
Most helpful comment
Hey @mchari this seems like a version mismatch, since the notebook is able to load models. Check out our colab notebook.
So I guess you are using the notebook locally with a custom python environment.
What version of transformers do you have installed? We currently use transformers==3.0.2