daquexian / onnx-simplifier

Simplify your onnx model
Apache License 2.0
3.67k stars 377 forks source link

[BUG] Nodes in a graph must be topologically sorted, however OpType: Loop is not output of any previous nodes. #335

Open Basicname opened 5 days ago

Basicname commented 5 days ago

Describe the bug A clear and concise description of what the bug is.

When converting paraformer model with option '--overwrite-input-shape speech:1,83,560 speech_lengths:1 bias_embed:1,2,512', onnxsim ended with error: onnx.onnx_cpp2py_export.checker.ValidationError: Nodes in a graph must be topologically sorted, however input 'onnx::Loop_8451' of node: name: Loop_9932 OpType: Loop is not output of any previous nodes. When I remove the option, it still happens. Note: Before the error, onnxsim outputs 'WARNING: failed to run "SequenceEmpty" op (name is "SequenceEmpty_9930"), skip...' Model To reproduce the problem, please post download link of your model here, or send your model to daquexian566@gmail.com Here is my model, which is converted from paraformer pytorch model by modelscope. Google Drive

Basicname commented 5 days ago

I think the problem is related to SequenceEmpty because Loop_8451 is from SequenceEmpty