You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I converted MobileNetV2 and InceptionV3, represented in h5 format to ONNX using convert_keras (). The model had been previously converted from PyTorch with input dimension (1, 3, 224, 224) (NCHW).
As a result, I noticed that the convert_keras(...) changed the dimension to (1, 224, 224, 3) (attempting to change it to NHWC) and a Transpose([0, 3, 1, 2]) node is introduced. However, this node does not work properly, as I receive wrong results.
I wrote a script that restored model inputs to the initial model and changes Transpose to do [0, 1, 2, 3] and the model worked in the same way as the original. I believe this has something to do with the converter mishandling the common dimensions of tensors internally.
In InceptionV3 the effect is even worse, because Gather and Unsqueeze nodes in the start of the model have also different axes order, which have also to be rectified. Once again, when resetting them to the original model dimensions, there was no problem in the model.