daquexian / onnx-simplifier

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

[BUG] Simplify removes local functions from the ONNX model #320

Open aernoudt opened 5 months ago

aernoudt commented 5 months ago

Describe the bug onnxsim.simplify (version 0.4.35) removes local functions from the model

Model The issue can be reproduced with following script: testLocalFunction.py.txt

After running onnxsim.simplify the local function MyReshapeFunction is removed from the model and inference fails. Commenting out lines 69 and 70 makes the inference work.

aernoudt commented 4 months ago

@daquexian any idea what causes this issue?