facebookresearch / DPR

Dense Passage Retriever - is a set of tools and models for open domain Q&A task.
Other
1.73k stars 304 forks source link

RuntimeError: Missing key(s) in state_dict: "encoder.embeddings.position_ids" #228

Open NehaNishikant opened 2 years ago

NehaNishikant commented 2 years ago

Hi,

I'm trying to get results from the DPR reader, but when I run the following command, I get this error.

command: python train_extractive_reader.py \ prediction_results_file=/home/nnishika/dprout/dpr_reader_on_stqa_decomps.json \ eval_top_docs=10 \ dev_files=/home/nnishika/dprout/dpr_on_stqa_decomps.json \ model_file=/home/nnishika/DPR/dpr/downloads/checkpoint/reader/nq-single/hf-bert-base.cp \ train.dev_batch_size=80 \ passages_per_question_predict=100 \ encoder.sequence_length=350

error: RuntimeError: Missing key(s) in state_dict: "encoder.embeddings.position_ids"

My model file is a reader checkpoint, so I'm not sure why this is happening. I tried with with this command too using a provided dev file (instead of the one I made) if you want to try reproducing this error.

python3 train_extractive_reader.py \ prediction_results_file=junk.out \ eval_top_docs=10 \ dev_files=/home/nnishika/DPR/dpr/downloads/data/retriever_results/nq/single-adv-hn/test.json \ model_file=/home/nnishika/DPR/dpr/downloads/checkpoint/reader/nq-single/hf-bert-base.cp \ train.dev_batch_size=8 \ passages_per_question_predict=100 \ encoder.sequence_length=350

Let me know if you get this error on your end too.

Thank you