Open Priyanshu88 opened 7 months ago
Reshape can only change the shape of the data. It does not create/destroy data.
In both cases the input to the Reshape node has no data as one of the dimensions is 0. So we can't 'reshape' no data to data with 1 element.
Most likely part of your model has some sort of selection logic, and nothing was selected, leading to a dimension with a value of 0.
It's also slightly unusual to be using Reshape with a target shape of {1}. Squeeze may be an alternative option as it would handle dims with a value of zero as it removes dimensions with a value of 1.
Reshape can only change the shape of the data. It does not create/destroy data.
In both cases the input to the Reshape node has no data as one of the dimensions is 0. So we can't 'reshape' no data to data with 1 element.
Most likely part of your model has some sort of selection logic, and nothing was selected, leading to a dimension with a value of 0.
It's also slightly unusual to be using Reshape with a target shape of {1}. Squeeze may be an alternative option as it would handle dims with a value of zero as it removes dimensions with a value of 1.
But why is this different for two different batch sizes? Any possible solution will work that would handle my case of conversion, also did you take a look at onnx config specific to model and it's expected behavior ? let me know any modification if you can provide.
This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.
Describe the issue
onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Non-zero status code returned while running Reshape node. Name:'/Reshape_16_output_0_ReduceMax_Reshape' Status Message: /onnxruntime_src/onnxruntime/core/providers/cpu/tensor/reshape_helper.h:44 onnxruntime::ReshapeHelper::ReshapeHelper(const onnxruntime::TensorShape&, onnxruntime::TensorShapeVector&, bool) input_shape_size == size was false. The input tensor cannot be reshaped to the requested shape. Input shape:{0,1}, requested shape:{1}
Urgency
Yeah urgency
Target platform
OpenMMLab
Build script
I am using the below config to convert the rtmo model to onnx model with the help of mmdeploy https://github.com/open-mmlab/mmdeploy/blob/main/configs/mmpose/pose-detection_rtmo_onnxruntime_dynamic.py
Error / output
Full log describing the path
When keeping the batch size as 32, am getting below failure.
onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Non-zero status code returned while running Reshape node. Name:'/Reshape_16_output_0_ReduceMax_Reshape' Status Message: /onnxruntime_src/onnxruntime/core/providers/cpu/tensor/reshape_helper.h:44 onnxruntime::ReshapeHelper::ReshapeHelper(const onnxruntime::TensorShape&, onnxruntime::TensorShapeVector&, bool) input_shape_size == size was false. The input tensor cannot be reshaped to the requested shape. Input shape:{0,1}, requested shape:{1}
When keeping the batch size as 1, am getting below failure.
[ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Non-zero status code returned while running Reshape node. Name:'/Tile_output_0_ReduceMax_Reshape' Status Message: /onnxruntime_src/onnxruntime/core/providers/cpu/tensor/reshape_helper.h:44 onnxruntime::ReshapeHelper::ReshapeHelper(const onnxruntime::TensorShape&, onnxruntime::TensorShapeVector&, bool) input_shape_size == size was false. The input tensor cannot be reshaped to the requested shape. Input shape:{1,0,1}, requested shape:{1}
Visual Studio Version
No response
GCC / Compiler Version
No response