Attached screenshot of the ONNX graph. On axis[2] = 2, the slice is attempting to slice from starts[2] = 0 to ends[2] = 10000 going backwards at steps[2] = -1, which doesn’t make sense.
Can you double check your model? Does it make sense in the Tensorflow model? If so, maybe an error with conversion using tf2onnx? Might want to post an issue at https://github.com/onnx/tensorflow-onnx/issues if so.
I don’t know the details of how ONNX works, but I think it is working as intended. Although the default values for begin/end indices are indeed rather strange, when I run
shape_inference.infer_shapes(model)
on my onnx model, I get the correct shapes:
[name: "strided_slice:0"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_value: 1
}
dim {
dim_value: 16
}
dim {
dim_value: 32
}
dim {
dim_value: 1
}
}
}
}
, name: "concat:0"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_value: 2
}
dim {
dim_value: 16
}
dim {
dim_value: 32
}
dim {
dim_value: 1
}
}
}
}
]
I tried to feed this model with inferred shapes to trtexec but got the same error.
The ONNX model may be corrupt after all, since I cannot use it for inference with the onnx runtime. I filed an issue there, and will update here if needed. Thanks.