-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to reshape input in replace.json #8
Comments
{
"format_version": 1,
"operations": [
{
"op_name": "Flatten_10",
"param_target": "inputs",
"param_name": "input.16",
"pre_process_transpose_perm": [0,3,1,2]
},
{
"op_name": "Flatten_10",
"param_target": "attributes",
"param_name": "axis",
"values": 1
}
]
}
It is understandable that the output results of the model will be corrupted if the dimensions are not reverted to the same dimensional order as the ONNX dimensions before flattening the dimensions. This is also true for openvino2tensorflow. It must be understood that the order of the elements of the array after flattening is different from the expected order.
This is a problem already described in the "Key concept" of the README: the tool's automatic conversion from NCHW to NHWC does not accurately estimate the shape of the pattern.
|
The conversion works now. Thank you very much for the fix and detailed explanation! |
Partial fix, Ref: 8954da0
|
Issue Type
Others
onnx2tf version number
1.0.27
Download URL for ONNX
https://drive.google.com/file/d/1Wkb-xi8NBICJttIyctUL3m7ETGHv2BZ8/view
Parameter Replacement JSON
Description
onnx2tf -i baseline_simplified.onnx -b 1
The onnx model has a Flatten layer. Input shape is ['batch_size', 32, 1, 3], output shape is ['batch_size', 96]. The OP get converted to tf.reshape, the input shape is (1, 1, 3, 32), output shape is (3, 32).
I attempted to solve it with the Parameter Replacement JSON to tranpose both the input and output. The transpose for the output works, but the transpose for the input gives me this error.
I need the tflite model so that I can quantise it and deploy using TFLiteMicro.
I have tried to use openvino library to convert onnx to openvino, then openvino to tf. I can convert but the output of tf model is very different from the onnx output.
The text was updated successfully, but these errors were encountered: