Mockingbird_替换vocoder为Fre-GAN

一.参考论文以及项目源码
1.知乎网址:语音合成论文优选:Fre-GAN: Adversarial Frequency-consistent Audio Synthesis
2.github项目源码:二.移植模块具体代码
1.vocodr_train.py中:选择需要训练的预训练模型

2.fregan/train.py和meldataset中:
(1)导入文件作相应修改
(2)对照hifigan中代码修改(添加#等)
3.在config.json中对训练参数进行配置,重点关注对输入频谱的处理函数传入参数
4.fregan文件夹下添加inference.py
5.在ui界面中加载预训练的fregan模型三.训练声码器模型
1.github作者教程
2.实际操作:
训练指令为:

hifigan:
预训练:python vocoder_preprocess.py F:\机器学习\实践\AI语音克隆\data -m F:\机器学习\实践\AI语音克隆\Parrot_V2\synthesizer\saved_models\fly_4_110k
python vocoder_train.py myvo F:\机器学习\实践\AI语音克隆\data hifigan


fregan:
python vocoder_train.py myvo F:\机器学习\实践\AI语音克隆\data --config config.json freganPS:本次Fre-GAN声码器的移植在训练时出现报错且已解决!
/data/cpf/Parrot_V3/vocoder/fregan/train.py:166: UserWarning: Using a target size (torch.Size([16, 80, 40])) that is different to the input size (torch.Size([16, 80, 32])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.
  loss_mel = F.l1_loss(y_mel, y_g_hat_mel) * 45
Traceback (most recent call last):
  File "vocoder_train.py", line 77, in
    train_fregan(0, args, h)
  File "/data/cpf/Parrot_V3/vocoder/fregan/train.py", line 166, in train
    loss_mel = F.l1_loss(y_mel, y_g_hat_mel) * 45
  File "/home/llp/.conda/envs/pytorch/lib/python3.8/site-packages/torch/nn/functional.py", line 3080, in l1_loss
    expanded_input, expanded_target = torch.broadcast_tensors(input, target)
  File "/home/llp/.conda/envs/pytorch/lib/python3.8/site-packages/torch/functional.py", line 72, in broadcast_tensors
    return _VF.broadcast_tensors(tensors)  # type: ignore[attr-defined]
RuntimeError: The size of tensor a (32) must match the size of tensor b (40) at non-singleton dimension 2

大概意思应该是y_mel和y_g_hat_mel的张量维度不相同

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值