RVC-Boss / GPT-SoVITS

1 min voice data can also be used to train a good TTS model! (few shot voice cloning)
MIT License
33.85k stars 3.88k forks source link

CNHubert.__init__() takes 1 positional argument but 2 were given #1545

Closed keepOrCounter closed 1 month ago

keepOrCounter commented 1 month ago

我在尝试运行GPT-SoVITS-v2-240821版本整合包中的api_v2.py,然而出现了下面的错误:

错误信息:

Loading CNHuBERT weights from GPT_SoVITS/pretrained_models/chinese-hubert-base
Traceback (most recent call last):
  File "/voiceClone/GPT-SoVITS-v2-240821/api_v2.py", line 144, in <module>
    tts_pipeline = TTS(tts_config)
  File "/voiceClone/GPT-SoVITS-v2-240821/GPT_SoVITS/TTS_infer_pack/TTS.py", line 243, in __init__
    self._init_models()
  File "/voiceClone/GPT-SoVITS-v2-240821/GPT_SoVITS/TTS_infer_pack/TTS.py", line 271, in _init_models
    self.init_cnhuhbert_weights(self.configs.cnhuhbert_base_path)
  File "/voiceClone/GPT-SoVITS-v2-240821/GPT_SoVITS/TTS_infer_pack/TTS.py", line 278, in init_cnhuhbert_weights
    self.cnhuhbert_model = CNHubert(base_path)
TypeError: CNHubert.__init__() takes 1 positional argument but 2 were given

以下是我的系统信息: CentOS Linux release 7.9.2009 (Core)

在报错之前我做的操作:

1.解压完整合包之后把8月07旧版本整合包训练的GPT_weights_v2与SoVITS_weights_v2权重复制了过来 2.修改了./config.py中的前两个权重路径: sovits_path = "/voiceClone/GPT-SoVITS-v2-240821/SoVITS_weights_v2/test1_e8_s104.pth" gpt_path = "/voiceClone/GPT-SoVITS-v2-240821/GPT_weights_v2/test1-e15.ckpt"

  1. 更新了环境:pip install -r requirements.txt -i https://pypi.mirrors.ustc.edu.cn/simple/
  2. 运行python api_v2.py,并在加载过程中报错

我去检查了./GPT_SoVITS/feature_extractor/cnhubert.py中的CNHubert类定义,但没有看出来什么问题。我不确定这个是不是因为整合包与系统的兼容性问题,但我能确定的是旧版本的GPT-SoVITS-v2-240807整合包的api与webui都能正常运行。

clearlove-civ6 commented 1 month ago

不能和别的项目用同样的环境

XXXXRT666 commented 1 month ago

不同的GSV不要共用环境

keepOrCounter commented 1 month ago

重新用conda开了一个环境,跑起来了。多谢~