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
{{ message }}
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.
Description: Slicing does not produce the same shape output after conversion if a variable is used as index.
code snippet
input = tf.keras.Input(shape=(( 114*4,122*5, 3)))
h = tf.shape(input)[1]
h2 = tf.cast(tf.math.divide(h,2), tf.int32)
x = input[:, h2: , : , :]
model = tf.keras.Model(input, x)
onnx_model = keras2onnx.convert_keras(model, model.name)
Running a (1, 456, 610, 3) input using tensorflow returns an output of shape (1, 228, 610, 3) while the onnx output returns a tensor of shape (1, 456, 610, 3).
I am fairly new to the Onnx, and am attempting to convert a custom model, but ran into the above issue in a middle layer where I attempt to half the image. I would appreciate any help getting the simple operation above to work, thank you.
The text was updated successfully, but these errors were encountered:
tommy2is
changed the title
Using variables in slicing does not applied
Variables in slicing are incorrectly applied when converted to onnx
Mar 16, 2021
Tensorflow version: 2.2
Keras onnx version: 1.7.0
Description: Slicing does not produce the same shape output after conversion if a variable is used as index.
code snippet
Running a (1, 456, 610, 3) input using tensorflow returns an output of shape (1, 228, 610, 3) while the onnx output returns a tensor of shape (1, 456, 610, 3).
I am fairly new to the Onnx, and am attempting to convert a custom model, but ran into the above issue in a middle layer where I attempt to half the image. I would appreciate any help getting the simple operation above to work, thank you.
The text was updated successfully, but these errors were encountered: