openvpi / DiffSinger

An advanced singing voice synthesis system with high fidelity, expressiveness, controllability and flexibility based on DiffSinger: Singing Voice Synthesis via Shallow Diffusion Mechanism
Apache License 2.0
2.69k stars 283 forks source link

Issue exporting to ONNX #81

Closed Mildemelwe closed 1 year ago

Mildemelwe commented 1 year ago

I'm getting an issue exporting my ckpt file to ONNX format. When I got this error before, I used oxygen-dioxide's ONNX export instead, and it worked, but now neither of them are working. The error is as follows:

Running ONNX simplifier...
Traceback (most recent call last):
  File "onnx/export/export_acoustic.py", line 1292, in <module>
    fix(diff_model_path, diff_model_path)
  File "onnx/export/export_acoustic.py", line 836, in fix
    model, check = onnxsim.simplify(model, include_subgraph=True)
  File "/home/kei/miniconda3/envs/diffsinger2/lib/python3.8/site-packages/onnxsim/onnx_simplifier.py", line 186, in simplify
    model_opt_bytes = C.simplify(
onnx.onnx_cpp2py_export.shape_inference.InferenceError: [ShapeInferenceError] (op_type:Add, node name: Add_1384): [TypeInferenceError] Inferred elem type differs from existing elem type: (DOUBLE) vs (FLOAT)
yqzhishen commented 1 year ago

Please use PyTorch 1.8

Mildemelwe commented 1 year ago

Thank you. I hadn't noticed, but for some reason my PyTorch version was changed in all my environments. It works now that I downgraded again.