netease-youdao / EmotiVoice

EmotiVoice 😊: a Multi-Voice and Prompt-Controlled TTS Engine
Apache License 2.0
6.9k stars 577 forks source 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". #9

Open lucasjinreal opened 8 months ago

lucasjinreal commented 8 months ago

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 commented 8 months ago

Win11, the same question

ninerui commented 8 months ago

install transformers==4.26.1

lucasjinreal commented 8 months ago

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

lucasjinreal commented 8 months ago

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 commented 8 months ago

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

huangxu1991 commented 7 months ago

for latest transformer

if new_key == 'bert.embeddings.position_ids':
    new_key = 'bert.embeddings.position_embeddings'
model_ckpt[new_key] = value
syq163 commented 7 months ago

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.