onnx2keras
onnx2keras copied to clipboard
About Slice Layer
Hello,
I have a problem related to slice layer .
My model is like this (I want to slice the ch dimension, and then concatenate them, i.e., I set axis attribute as 1 in slice layer in an onnx file)

I add a slice layer after the first conv layer but while converting this model to tflite model, it will show that the input of concat layer is mismatch
I print the shape of slice layer like this:
For the upper part, it is normal (slice input to two tensors with 4 channels and 12 channels),
but for lower part, it slices the wrong dimension
I use the setting of change_ordering=True with onnx2keras==0.0.17
Do you have any suggestion ? Thanks a lot :)
Hello.
I encountered a same issue, and the cause seems to be in tf.nn.strided_slice()
according to my test.
I fixed it and you can refer to the PR #55 .
(In my repository forked from here, I changed onnx2keras/reshape_layers.py/convert_slice()
)
Best regards.