使用hifigan_24k报错 KeyError: 'model_state'
- Dominant language
- Python
- Stars
- 36.9k
- Forks
- 5.2k
- PR merge metrics
- No merged PRs in 30d
Description
**Summary[问题简述(一句话)]**
Vocoder使用hifigan_24k报错 KeyError: 'model_state',输出为杂音。使用pretrained或g_hifigan则正常。
**Env & To Reproduce[复现与环境]**
模型从readme的百度网盘下载
版本为最新的main分支。
从百度网盘下载模型放入对应目录后,vocoder选择hifigan_24k的时候就会报错。但是点击生成仍然可以正常运行,只是出来的都是杂音。
**Screenshots[截图(如有)]**
```
Traceback (most recent call last):
File "/Users/xxx/Files/MockingBird/toolbox/__init__.py", line 467, in init_vocoder
vocoder.load_model(model_fpath, model_config_fpath)
File "/Users/xxx/Files/MockingBird/vocoder/wavernn/inference.py", line 37, in load_model
_model.load_state_dict(checkpoint['model_state'])
KeyError: 'model_state'
```

Contributor guide
No contributing guide indexed for this repository
Research direction
Start in toolbox/__init__.py at init_vocoder and then read vocoder/wavernn/inference.py, especially load_model where checkpoint['model_state'] is accessed. Compare the hifigan_24k model downloaded from the README with the working pretrained or g_hifigan models. Done means hifigan_24k loads without the KeyError and generated audio is no longer noise.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100