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(s) in loading state_dict for SequenceTagger: Unexpected key(s) in state_dict: "lstm_init_h", "lstm_init_c". #3009

Closed
ambuje opened this issue Dec 5, 2022 · 1 comment
Labels
question Further information is requested

Comments

@ambuje
Copy link

ambuje commented Dec 5, 2022

from flair.models import SequenceTagger
tagger : SequenceTagger = SequenceTagger(hidden_size=128,
embeddings=embeddings,dropout=0.2,locked_dropout=0.2,
tag_dictionary=tag_ditionary1,train_initial_hidden_state=True,
tag_type=tag_type,rnn_layers=4,tag_format='BIO',
use_crf=False)

If train_initial_hidden_state=True, then we receive the error:-

Error(s) in loading state_dict for SequenceTagger:
Unexpected key(s) in state_dict: "lstm_init_h", "lstm_init_c".

Task - NER

Can you please help me out?

Thank you

@ambuje ambuje added the question Further information is requested label Dec 5, 2022
@helpmefindaname
Copy link
Collaborator

Hi @ambuje
seems like this is currently not possible, I created a PR to fix it, can you try out the following: #3010 and see if that works for you?

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

2 participants