目录

mac部署GPT-SoVITS,生成粤语踩坑点及使用记录

mac部署GPT-SoVITS,生成粤语踩坑点及使用记录

自己录音,普通话或者粤语

注意:

与在其他设备上训练的模型相比,在mac上使用gpu训练的模型的质量明显较低,因此我们暂时使用cpu代替。

  1. Install Xcode command-line tools by running xcode-select --install .
  2. Install FFmpeg by running brew install ffmpeg .
  3. Install the program by running the following commands:
conda create -n GPTSoVits python=3.9
conda activate GPTSoVits
pip install -r requirements.txt

注意py的版本

激活环境:

conda activate GPTSoVits 

在macos上训练自己的声音

激活环境:

conda activate GPTSoVits 

第一踩坑点

启动命令:

python3 webui.py

之后,无法跳转,显示超时

File "/opt/anaconda3/envs/GPTSoVits/lib/python3.9/site-packages/pydantic/_internal/_generate_schema.py", line 558, in _unknown_type_schema
    raise PydanticSchemaGenerationError(
pydantic.errors.PydanticSchemaGenerationError

解决方法:

pip uninstall fastapi
pip install fastapi==0.112.2

成功跑起:

第二个踩坑点

是在微调训练gpt报错

RuntimeError: Index tensor must have the same number of dimensions as self tensor
return torch.zeros_like(preds_oh, dtype=torch.int32).scatter_(-1, result.unsqueeze(1).unsqueeze(1), 1)
RuntimeError: Index tensor must have the same number of dimensions as self tensor
​![](https://i-blog.csdnimg.cn/direct/3b45162662874d938358f3e2ee833da6.png)

解决方法:

pip install torchmetrics==1.5

最后成功跑起 https://i-blog.csdnimg.cn/direct/e0fe2330dfa648f88b8d0c78b08ef9c7.png

https://i-blog.csdnimg.cn/direct/5f8cc98433e348d3a052a8574f7c8242.png

效果:

https://i-blog.csdnimg.cn/direct/30b81751392347aeb40faa04a8c843c0.png

CondaError: Run ‘conda init’ before ‘conda activate’

利用 连接远程服务器,在创建conda环境后报错。

输入conda init后返回No action taken.

解决方法

  1. 输入 ,后发现前面多了(base)
  2. 输入conda activate xxx(此处为自定义的环境名称),后发现(base)变为(xxx)

参考: https://i-blog.csdnimg.cn/direct/ff28c55103bd4bc2bf90d2f9f1c29957.png

使用教程记录

https://i-blog.csdnimg.cn/direct/6034affe942c4491a8ec3d533282c987.png

语音切割,降噪,进行选择语音,就可以打标了

https://i-blog.csdnimg.cn/direct/60d9faa9c562442eb3404966b87517ec.png

打标界面

https://i-blog.csdnimg.cn/direct/17ed4c38c6484723b775d1d85fc38963.png

之后可以进行训练了

https://i-blog.csdnimg.cn/direct/f344991df8c04c4a99e2ef09ad4abd52.png https://i-blog.csdnimg.cn/direct/8410f64299314975ac330cacdeed68f1.png

https://i-blog.csdnimg.cn/direct/1fec79bea63d4ddf963c8e0ef287bdcb.png

微调模型 https://i-blog.csdnimg.cn/direct/068826839ea345c48f8a7481c50027ce.png

https://i-blog.csdnimg.cn/direct/71fab31d572b4f2f856a6f161f1632f9.png https://i-blog.csdnimg.cn/direct/b46f1d450cd442c3a66accc7901780bf.png

终端

https://i-blog.csdnimg.cn/direct/4037a6c8087a472dbb54c282079ca577.png