Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lizuobin opened this issue Jan 16, 2024 · 1 comment
Open

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

lizuobin opened this issue Jan 16, 2024 · 1 comment

Comments

@lizuobin
Copy link

尝试使用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_onnx_aishell3.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
Copy link

11Boss commented Apr 25, 2024

可以使用sherpa-onnx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants