Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

EmotiVoice/inference_am_vocoder_joint.py", line 66, in main style_encoder.load_state_dict(model_ckpt) File "/root/anaconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 2152, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for StyleEncoder: Unexpected key(s) in state_dict: "bert.embeddings.position_ids". #9

Open
lucasjinreal opened this issue Nov 13, 2023 · 7 comments

Comments

@lucasjinreal
Copy link

EmotiVoice/inference_am_vocoder_joint.py", line 66, in main
style_encoder.load_state_dict(model_ckpt)
File "/root/anaconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 2152, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for StyleEncoder:
Unexpected key(s) in state_dict: "bert.embeddings.position_ids".

@ashuoAI
Copy link

ashuoAI commented Nov 13, 2023

Win11, the same question

@ninerui
Copy link

ninerui commented Nov 14, 2023

install transformers==4.26.1

@syq163 syq163 closed this as completed Nov 14, 2023
@lucasjinreal
Copy link
Author

。。。。。。 the lastest comes to 4.35 now........ Why strictly the transformers lib rather than make it compatible latest?
I am so confused

@lucasjinreal
Copy link
Author

You strict requirements will break all users' other toolchains. Even though you can say use virtual env is your choice but why should we waste time to create a new env??

@lucasjinreal
Copy link
Author

@syq163 Why do u close this issue? Many users might come to this error and didn't notice exactly reason of this.

@syq163 syq163 reopened this Nov 18, 2023
@huangxu1991
Copy link

huangxu1991 commented Dec 6, 2023

for latest transformer

if new_key == 'bert.embeddings.position_ids':
    new_key = 'bert.embeddings.position_embeddings'
model_ckpt[new_key] = value

@syq163
Copy link
Collaborator

syq163 commented Dec 7, 2023

Thank you for your assistance. The latest code has attempted to resolve the dependency issue with 'transformers==4.26.1'. You are encouraged to update and check if the problem has been resolved.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants