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 format #3

Closed
AigizK opened this issue Sep 7, 2023 · 3 comments
Closed

ONNX format #3

AigizK opened this issue Sep 7, 2023 · 3 comments

Comments

@AigizK
Copy link

AigizK commented Sep 7, 2023

You could use this PR: p0p4k/vits2_pytorch#43

@w11wo
Copy link

w11wo commented Sep 8, 2023

I've attempted to apply the same exporting script to MB-iSTFT-VITS2, but I'm running into some trouble during the export. I think it's related to complex numbers being only partially supported by torch.onnx, or something along those lines.

Here's the error log in case anyone's interested:

Traceback (most recent call last):
  File "/content/MB-iSTFT-VITS2/export_onnx.py", line 110, in <module>
    main()
  File "/content/MB-iSTFT-VITS2/export_onnx.py", line 91, in main
    torch.onnx.export(
  File "/usr/local/lib/python3.10/dist-packages/torch/onnx/utils.py", line 506, in export
    _export(
  File "/usr/local/lib/python3.10/dist-packages/torch/onnx/utils.py", line 1548, in _export
    graph, params_dict, torch_out = _model_to_graph(
  File "/usr/local/lib/python3.10/dist-packages/torch/onnx/utils.py", line 1117, in _model_to_graph
    graph = _optimize_graph(
  File "/usr/local/lib/python3.10/dist-packages/torch/onnx/utils.py", line 658, in _optimize_graph
    _C._jit_pass_erase_number_types(graph)
RuntimeError: Unknown number type: complex

To reproduce, I've prepared a Colab notebook here. It uses the models from here.

@FENRlR
Copy link
Owner

FENRlR commented Sep 9, 2023

pytorch/pytorch#81075
It looks like we need more time for this.

@nshmyrev
Copy link
Contributor

nshmyrev commented Oct 1, 2023

It is actually easy to export, see the patch here:

alphacep@29c91d4

@FENRlR FENRlR closed this as completed Oct 9, 2023
FENRlR referenced this issue Oct 9, 2023
resolve #6

Co-authored-by: nshmyrev <nshmyrev@gmail.com>
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

4 participants