UnboundLocalError: local variable 'ppg' referenced before assignment
- Dominant language
- Python
- Stars
- 36.9k
- Forks
- 5.2k
- PR merge metrics
- No merged PRs in 30d
Description
**Summary[问题简述(一句话)]**
上传自己的wav文件报UnboundLocalError: local variable 'ppg' referenced before assignment
**Env & To Reproduce[复现与环境]**
描述你用的环境、代码版本、模型
Windows 10 ,python3.8 按照readme.txt安装成功 ,执行python demo_toolbox.py -vc -d "E:\3DData\sounddata\"
**Screenshots[截图(如有)]**

出错信息:
Traceback (most recent call last):
File "E:\1JSONPro\MBIRD\control\toolbox\__init__.py", line 141, in
func = lambda: self.convert() or self.vocode()
File "E:\1JSONPro\MBIRD\control\toolbox\__init__.py", line 378, in convert
min_len = min(ppg.shape[1], len(lf0_uv))
UnboundLocalError: local variable 'ppg' referenced before assignment
Traceback (most recent call last):
File "E:\1JSONPro\MBIRD\control\toolbox\__init__.py", line 141, in
func = lambda: self.convert() or self.vocode()
File "E:\1JSONPro\MBIRD\control\toolbox\__init__.py", line 378, in convert
min_len = min(ppg.shape[1], len(lf0_uv))
UnboundLocalError: local variable 'ppg' referenced before assignment
Traceback (most recent call last):
File "E:\1JSONPro\MBIRD\control\toolbox\__init__.py", line 141, in
func = lambda: self.convert() or self.vocode()
File "E:\1JSONPro\MBIRD\control\toolbox\__init__.py", line 378, in convert
min_len = min(ppg.shape[1], len(lf0_uv))
UnboundLocalError: local variable 'ppg' referenced before assignment
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the failure with `python demo_toolbox.py -vc -d "E:\3DData\sounddata\"` on the reported Windows/Python environment. Read `control/toolbox/__init__.py` around the `convert` method and line 378, then trace the paths that lead to `ppg.shape[1]`; done means the uploaded WAV no longer raises `UnboundLocalError` during conversion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100