Conv and KERAS storage_order does not match - is this right #4099
-
Hi, is it right to say, that the operator Conv (used for Conv1D) in onnx does not support the supported storage_order "channels_last" (or "NWC"). Does it mean, that using onnx requires me to transpose the input data every time Conv1D is used? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 16 replies
-
Hi @ed-mr, |
Beta Was this translation helpful? Give feedback.
-
thank you, that you had a second look at it and obviously digged into it. |
Beta Was this translation helpful? Give feedback.
-
Thank @ed-mr for rounting me here. I did complain about ONNX's flexiblity of data layouts when creating ONNX is a protocal, a language, which needs to be understood by the exporters and importers. Understanding is a non-trivial effort. As of now, the tools know the NCHW constraint and can easily generate or parse the semantic of the particular operator. They can insert Transpose to the local graph or do layout propagation across graph (
So, the understanding effort as of now is inserting Transpose to the graph. The backends should optimize the graph. Consider that we have So, the understanding effort is inserting Transpose to the graph still (with the attribution in addition). Seems not much benefit. Another problem is that such change would create new version for base operators like Conv, which might not be widely supported by the ecosystem soon. That's why I changed my opinion - flexibility is good, and far more good if for free (no additional complexility). I like the local function solution mentioned by @jcwchen which I think is really important to the ONNX ecosystem. I sometimes wondering why there are so many ONNX operators... TensorRT has put significant efforts to enable but there are more... |
Beta Was this translation helpful? Give feedback.
Thank @ed-mr for rounting me here. I did complain about ONNX's flexiblity of data layouts when creating
tflite2onnx
and spend much effort to resolve it. I agree that the NCHW constraint put burdens on the exporters and importers of ONNX. But two years later as of today, I think the NCHW constraints are acceptable.ONNX is a protocal, a language, which needs to be understood by the exporters and importers. Understanding is a non-trivial effort.
As of now, the tools know the NCHW constraint and can easily generate or parse the semantic of the particular operator. They can insert Transpose to the local graph or do layout propagation across graph (
tflite2onnx
use the later approach). If the d…