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

error when running FinBert Model Example.ipynb #14

Closed
turmeric-blend opened this issue Oct 29, 2020 · 3 comments
Closed

error when running FinBert Model Example.ipynb #14

turmeric-blend opened this issue Oct 29, 2020 · 3 comments

Comments

@turmeric-blend
Copy link

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".
@yya518
Copy link
Owner

yya518 commented Nov 14, 2020

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

@ReneeRuiFAN
Copy link

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

@yya518
Copy link
Owner

yya518 commented Jul 30, 2021

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.

@yya518 yya518 closed this as completed Jul 30, 2021
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

3 participants