Plachtaa / VITS-fast-fine-tuning

This repo is a pipeline of VITS finetuning for fast speaker adaptation TTS, and many-to-many voice conversion
Apache License 2.0
4.65k stars 698 forks source link

纯中文模型如何转换成onnx格式 #568

Open lizuobin opened 6 months ago

lizuobin commented 6 months ago

尝试使用aishell3的onnx转换脚本,报错如下: warnings.warn("torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.") Traceback (most recent call last): File "/media/nvme500/work/sda/models/pytorch/vits_chinese/export_onnx_aishell3.py", line 147, in main() File "/home/lzb/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "/media/nvme500/work/sda/models/pytorch/vits_chinese/export_onnxaishell3.py", line 85, in main = utils.load_checkpoint(checkpoint, net_g, None) File "/media/nvme500/work/sda/models/pytorch/vits_chinese/utils.py", line 40, in load_checkpoint model.load_state_dict(new_state_dict) File "/home/lzb/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2152, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for SynthesizerTrn: size mismatch for enc_p.emb.weight: copying a param with shape torch.Size([50, 192]) from checkpoint, the shape in current model is torch.Size([219, 192]). 有没有大佬指点一下,该如何转换?

11Boss commented 2 months ago

可以使用sherpa-onnx