[babysor/MockingBird]UnboundLocalError: local variable 'sample_rate' referenced before assignment 报错

2024-06-27 402 views
3

能打开BOX,但是,不知道为什么,不管用那种模型,合成出来的声音都听不了,就是全是杂音。(中英文都不得行)

回答

5

在哪个代码版本?

1
 File "C:\Users\Axel\PycharmProjects\playground\mb\MockingBird\toolbox\__init__.py", line 304, in vocode
    breaks = [np.zeros(int(0.15 * sample_rate))] * len(breaks)

master分支 @babysor

3

遇到相同问题了,Vocoder设置为g_hifigan和pretrained没问题,但是设置为Griffin-Lim出现如下报错:

Traceback (most recent call last):
  File "F:\RealtimeVoiceCloneCN\MockingBird\toolbox\__init__.py", line 143, in <lambda>
    func = lambda: self.synthesize() or self.vocode()
  File "F:\RealtimeVoiceCloneCN\MockingBird\toolbox\__init__.py", line 304, in vocode
    breaks = [np.zeros(int(0.15 * sample_rate))] * len(breaks)
UnboundLocalError: local variable 'sample_rate' referenced before assignment
4

修改toolbox\__init__.py 297 行,增加 sample_rate=Synthesizer.sample_rate 重启启动运行即可修复bug!

自己动手丰衣足食!

9

感谢!有可能协助修改发起一个pull request吗

3

可以!

@.***

发件人: Vega 发送时间: 2022-05-13 13:42 收件人: babysor/MockingBird 抄送: zfb7901; Comment 主题: Re: [babysor/MockingBird] UnboundLocalError: local variable 'sample_rate' referenced before assignment 报错 (Issue #488) 修改toolboxinit.py 297 行,增加 sample_rate=Synthesizer.sample_rate 重启启动运行即可修复bug! 自己动手丰衣足食! 感谢!有可能协助修改发起一个pull request吗 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

8

给开一下权限!

4

给开一下权限!

你可以从你fork的项目发起一个pull request到这里,或者直接推到你的项目里,我来发起。