onnx-simplifier
onnx-simplifier copied to clipboard
Not getting shape information for some Node output
Hi, First of all thanks very much for your Tool. It is very much helpful.
Actually, I am using an onnx-simplifier tool to get the shape information for each node of the ONNX Model. I used https://convertmodel.com/ to convert the model, but for some nodes, it is not showing the Shape Information(I have attached the pic below).

It will be a great help from your side if you can assist me in getting shape information of all the nodesof the ONNX. I am attaching my onnx model here: https://drive.google.com/file/d/13VzrdM7k8Eyoqp3eiK0m7HiMjxi6wERx/view?usp=sharing
Thanks in advance
Thanks for your issue!
Could you try the python version? The web version has some known bugs.
Darshan C Ganji [email protected] 于 2021年2月14日周日 上午5:52写道:
Hi, First of all thanks very much for your Tool. It is very much helpful.
Actually, I am using an onnx-simplifier tool to get the shape information for each node of the ONNX Model. I used https://convertmodel.com/ to convert the model, but for some nodes, it is not showing the Shape Information(I have attached the pic below). [image: Screenshot from 2021-02-14 03-15-13] https://user-images.githubusercontent.com/48723743/107862478-19518780-6e73-11eb-848b-e1f08b48c1aa.png
It will be a great help from your side if you can assist me in getting shape information of all the nodesof the ONNX. I am attaching my onnx model here: https://drive.google.com/file/d/13VzrdM7k8Eyoqp3eiK0m7HiMjxi6wERx/view?usp=sharing
Thanks in advance
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/daquexian/onnx-simplifier/issues/123, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYRZH6EVWWLCO6PVGPTKW3S63YCTANCNFSM4XSRKGMQ .
Hi @daquexian,
Thanks for your reply. I have tried with the python version but don't know why the conversion is going wrong. I am attaching both the Models(before conversion and after Conversion): Before Conversion: https://drive.google.com/file/d/13VzrdM7k8Eyoqp3eiK0m7HiMjxi6wERx/view?usp=sharing After Conversion: https://drive.google.com/file/d/1i1WXgbW4qNDjE_5e10K1Du8i2vwWe827/view?usp=sharing
Command used: python3 -m onnxsim model.onnx model_simple.onnx --skip-optimization
Can you please assist me in the correct conversion of this Model?
Thanks in Advance, Darshan
It seems a bug of onnxruntime that makes the simplification without "--skip-optimization" fail. I have submitted an issue to onnxruntime https://github.com/microsoft/onnxruntime/issues/6691.
I will release a new version with a workaround for this issue soon (maybe tomorrow).
Darshan C Ganji [email protected] 于 2021年2月15日周一 上午12:20写道:
Hi @daquexian https://github.com/daquexian,
Thanks for your reply. I have tried with the python version but don't know why the conversion is going wrong. I am attaching both the Models(before conversion and after Conversion): Before Conversion: https://drive.google.com/file/d/13VzrdM7k8Eyoqp3eiK0m7HiMjxi6wERx/view?usp=sharing After Conversion: https://drive.google.com/file/d/1i1WXgbW4qNDjE_5e10K1Du8i2vwWe827/view?usp=sharing
Command used: python3 -m onnxsim slow_fast.onnx slow_fast_simple.onnx --skip-optimization
Can you please assist me in the correct conversion of this Model?
Thanks in Advance, Darshan
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/daquexian/onnx-simplifier/issues/123#issuecomment-778800646, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYRZHZZ37RE3CNYBZVZZQLS67Z6HANCNFSM4XSRKGMQ .
Hi @daquexian,
Thank you very much for your kind response and also for your support. I will be eagerly waiting for the release of the new version.
Thanks and Regards, Darshan.
Hi @daquexian,
Whether the Bug is Fixed? Actually, I just wanted the Shape information of Einsum Node in that Model. Would be a great help if you can help me in getting the shape information of the Einsum Node.
Thanks and Regards, Darshan
I just published a new version. Could you please upgrade onnxsim to 0.3.2 and try it again?
On Wed, 17 Feb 2021 at 14:10, Darshan C Ganji [email protected] wrote:
Hi @daquexian https://github.com/daquexian,
Whether the Bug is Fixed? Actually, I just wanted the Shape information of Einsum Node in that Model. Would be a great help if you can help me in getting the shape information of the Einsum Node.
Thanks and Regards, Darshan
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/daquexian/onnx-simplifier/issues/123#issuecomment-780327195, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYRZHYU2RIQAKTEMUIIUMTS7NMW7ANCNFSM4XSRKGMQ .
I have processed your model with the latest onnxsim. However, I'm afraid that because of the implementation of onnx shape inference, what we can only get is the rank (dimension num) of einsum node is 3. The precise shape inference of einsum op is not implemented in onnx.
On Wed, 17 Feb 2021 at 15:30, quexian da [email protected] wrote:
I just published a new version. Could you please upgrade onnxsim to 0.3.2 and try it again?
On Wed, 17 Feb 2021 at 14:10, Darshan C Ganji [email protected] wrote:
Hi @daquexian https://github.com/daquexian,
Whether the Bug is Fixed? Actually, I just wanted the Shape information of Einsum Node in that Model. Would be a great help if you can help me in getting the shape information of the Einsum Node.
Thanks and Regards, Darshan
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/daquexian/onnx-simplifier/issues/123#issuecomment-780327195, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYRZHYU2RIQAKTEMUIIUMTS7NMW7ANCNFSM4XSRKGMQ .
Hi @daquexian,
Thanks for your reply. Is there any way to get the Shape Information of Einsum Operator Only?
Thanks
I think there is no easy way. The only way is implementing shape inference of einsum op yourself in https://github.com/onnx/onnx/blob/master/onnx/defs/math/defs.cc#L3311
On Wed, 17 Feb 2021 at 16:20, Darshan C Ganji [email protected] wrote:
Hi @daquexian https://github.com/daquexian,
Thanks for your great help. Is there any way to get the Shape Information of Einsum Operator Only?
Thanks
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/daquexian/onnx-simplifier/issues/123#issuecomment-780387027, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYRZHZVBIGGFHHCRJIVHITS7N34JANCNFSM4XSRKGMQ .
Hi @daquexian,
Somehow I got to know the shape of the Reshape output(which are going as an Input to the Einsum Op) through verbose of trtexec.
Reshape_187 [Reshape] inputs: [1569 -> (1, 512, 8, 16, 29)], [1578 -> (3)], outputs: [1579 -> (-1, -1, -1)]
Reshape_190 [Reshape] inputs: [1571 -> (1, 512, 4, 8, 14)], [1585 -> (3)], outputs: [1586 -> (-1, -1, -1)]

Verbose of trtexec:

I quite surprise of the reshape output as: (-1, -1, -1), is it correct or something is going wrong?
Thanks
Hi @daquexian, Any thoughts on the same?
Thanks
I think this is relevant: https://github.com/onnx/onnx/issues/6011