Open juliomilani opened 1 month ago
Hi @juliomilani .
Sorry, I gave this problem ~15 minutes, but couldn't figure out anything. I sort of suspect this is a limitation of onnx rather than a limitation of tochvision, because removing the onnx part makes the code run. But it's hard to confirm given the quality of onnx error messages...
Its working fine with model alone
🐛 Describe the bug
I get an ONNXRuntimeError when running FasterRCNN model exported to .onnx
Here is a minimal reproductible example:
obs: The error shows up only in the cropped image. If I comment out
img = img[50:200, 150:250]
- it works fine.Error: onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Non-zero status code returned while running Reshape node. Name:'/roi_heads/Reshape_2' Status Message: /onnxruntime_src/onnxruntime/core/providers/cpu/tensor/reshape_helper.h:39 onnxruntime::ReshapeHelper::ReshapeHelper(const onnxruntime::TensorShape&, onnxruntime::TensorShapeVector&, bool) size != 0 && (input_shape_size % size) == 0 was false. The input tensor cannot be reshaped to the requested shape. Input shape:{490,363}, requested shape:{-1,4}
Versions
onnxruntime 1.18.1 torch 2.2.2 torchvision 0.17.2