yya518/FinBERT

error when running FinBert Model Example.ipynb

turmeric-blend opened this issue · 3 comments

when running model.load_state_dict(torch.load(fine_tuned_weight_path, map_location=device)) from FinBert Model Example.ipynb from my local machine, I ran into this error:

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

did you download the pre-trained and fine-tuned weights folder?

I got the same error. And I downloaded the pre-trained and fine-tuned weights folder.

I believe the error is related to the library version. The notebook was developed using pytorch-pretrained-bert==0.6.2.
BTW, the model is now integrated with transformers. give it a try using the transformers interface.