Skip to content

zh_en_tts 推理出错 #2294

@sixyang

Description

@sixyang

报错如下所示:

acoustic model done!
voc done!
Traceback (most recent call last):
  File "/root/autodl-tmp/PaddleSpeech-r1.1.0/paddlespeech/t2s/exps/fastspeech2/../synthesize_e2e.py", line 262, in <module>
    main()
  File "/root/autodl-tmp/PaddleSpeech-r1.1.0/paddlespeech/t2s/exps/fastspeech2/../synthesize_e2e.py", line 258, in main
    evaluate(args)
  File "/root/autodl-tmp/PaddleSpeech-r1.1.0/paddlespeech/t2s/exps/fastspeech2/../synthesize_e2e.py", line 106, in evaluate
    frontend_dict = run_frontend(
  File "/root/autodl-tmp/PaddleSpeech-r1.1.0/paddlespeech/t2s/exps/syn_utils.py", line 193, in run_frontend
    input_ids = frontend.get_input_ids(
  File "/root/autodl-tmp/PaddleSpeech-r1.1.0/paddlespeech/t2s/frontend/mix_frontend.py", line 253, in get_input_ids
    phones_seg.append(input_ids["phone_ids"][0])
UnboundLocalError: local variable 'input_ids' referenced before assignment

定位到问题如下所示:

242                 if lang == "zh":
243                     input_ids = self.zh_frontend.get_input_ids(
244                         content,
245                         merge_sentences=True,
246                         get_tone_ids=get_tone_ids,
247                         to_tensor=to_tensor)
248 
249                 elif lang == "en":
250                     input_ids = self.en_frontend.get_input_ids(
251                         content, merge_sentences=True, to_tensor=to_tensor)
252 
253                 phones_seg.append(input_ids["phone_ids"][0])
254                 if add_sp:
255                     phones_seg.append(self.sp_id_tensor)

这里应该是没有更新 lang 的 mix 选项~

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions