miriambellver / refvos

RefVOS
MIT License
28 stars 5 forks source link

Failed to load ck_bert #2

Open 13331112522 opened 3 years ago

13331112522 commented 3 years ago

When loading the ck_model para which download the pretrained checkpoints bert_pretrained_refcoco.zip and unzip and put in the /checkpoints_bert/ folder. The error occured as below:

RuntimeError: Error(s) in loading state_dict for BertModel: Missing key(s) in state_dict: "embeddings.position_ids".

The corresponding code was bert_model.load_state_dict(checkpoint['bert_model'])

Starboy-at-earth commented 3 years ago

I have encountered the same problem as yours. Could you please tell me how you fix this problem? Thank you in advance!!! @miriambellver @gianniskazakos

zichengsaber commented 2 years ago

Try this bert_model.load_state_dict(checkpoint['bert_model'],strict=False)