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

[Question]: Error(s) in loading state_dict for TextClassifier #3290

Closed
nowhash opened this issue Aug 1, 2023 · 3 comments
Closed

[Question]: Error(s) in loading state_dict for TextClassifier #3290

nowhash opened this issue Aug 1, 2023 · 3 comments
Labels
question Further information is requested

Comments

@nowhash
Copy link

nowhash commented Aug 1, 2023

Question

Whenever I try to load the previously saved model encountered the following error:

RuntimeError: Error(s) in loading state_dict for TextClassifier:
	Unexpected key(s) in state_dict: "embeddings.embeddings.list_embedding_0.list_embedding_0.model.embeddings.position_ids", "embeddings.embeddings.list_embedding_0.list_embedding_1.model.embeddings.position_ids". 

How to solve the issue?

@nowhash nowhash added the question Further information is requested label Aug 1, 2023
@nowhash nowhash closed this as completed Aug 1, 2023
@mct-lrh
Copy link

mct-lrh commented Aug 14, 2023

Hey @nowhash , how did you resolve this?

@nowhash
Copy link
Author

nowhash commented Aug 16, 2023

Hey @nowhash , how did you resolve this?

So far I understand, the reason for getting this error is that I saved the model using flair 0.12. Later I tried to load the model using the updated flair version 0.12.2. To resolve this issue, I've installed Flair version 0.12 instead of the latest one.

@helpmefindaname
Copy link
Collaborator

For any future readers: this bug is handled here: #3284

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants