ZhangGe6 / onnx-modifier

A tool to modify ONNX models in a visualization fashion, based on Netron and Flask.
MIT License
1.28k stars 157 forks source link

Output is not added successfully问题 #112

Closed Tsuuuki223 closed 1 month ago

Tsuuuki223 commented 1 month ago

您好,感谢您制作出这么好的工具。 在使用的时候,我发现了一个问题,如果我把某个节点和后面的节点通过Delete with children删除,然后给这个节点前面的节点使用add output增加一个输出,就会出现xxx is not added successfully!问题。

test.onnx.zip 为了复现这个问题,我上传了一个简单的只有三层的onnx文件。点击第二个conv并且Delete with children,然后点击Maxpool并Add Output,之后保存模型,就会有 WARNING:root:/1/MaxPool_output_0 is not added successfully!的错误,保存的模型里是没有output的。

同时,如果我先给MaxPool添加一个Output后保存模型为temp.onnx,然后读取这个模型,并且对第二个Conv进行Delete with children操作,得到的模型就是正常的。

可以请您看一下这个问题吗

ZhangGe6 commented 1 month ago

@Tsuuuki223 谢谢反馈,这个问题我本地没法复现,可以在给第二个conv Delete with children的基础上,正常给Maxpool加上Output。麻烦分享一下终端的完整log,以及onnx, onnx-tool的版本。我的相关信息如下,供参考:

终端log

~/onnx-modifier: python .\app.py
 * Serving Flask app 'app'
 * Debug mode: off
INFO:werkzeug:WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:5000
INFO:werkzeug:Press CTRL+C to quit
INFO:werkzeug:127.0.0.1 - - [24/Jul/2024 21:39:29] "GET / HTTP/1.1" 200 -
...
INFO:werkzeug:127.0.0.1 - - [24/Jul/2024 21:39:29] "GET /static/logo.svg HTTP/1.1" 304 -
INFO:root:loading model...
INFO:root:load done!
...
WARNING:root:[EXPERIMENTAL] Do shape inference automatically...
INFO:root:saving model...
INFO:root:model saved in ~/onnx-modifier/modified_onnx !

onnx版本为1.12.0, onnx-tool版本为0.8.1

Tsuuuki223 commented 1 month ago

@ZhangGe6 您好,感谢您的回复,抱歉我没有注意版本问题,我使用的是onnx 1.12.0 + onnx_tool 0.6.4,在升级到onnx_tool 0.8.1后可以正常使用。