Hello, I've seen other people deal with similar issue, but unable to find the solution to it. I've converted Darknet model => ONNX using demo_darknet2onnx.py file. My export function looks like this:
However inference only works with model (height, width) - in this case image with shape=1x3x2976x64. Anything else (ex.: shape=1x3x992x64) results in:
outputs = session.run(['boxes', 'confs'], {'input': img_in})return self._sess.run(output_names, input_feed, run_options)onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Non-zero status code returned while running Add node. Name:'Add_1514' Status Message: D:\a\_work\1\s\onnxruntime\core/providers/cpu/math/element_wise_ops.h:505 onnxruntime::BroadcastIterator::Append axis == 1 || axis == largest was false. Attempting to broadcast an axis by a dimension other than 1. 2 by 93
I understand that this part of code fails as stated in error:
try:
return self._sess.run(output_names, input_feed, run_options) #<------- THIS ONE
except C.EPFail as err:
if self._enable_fallback:
print("EP Error: {} using {}".format(str(err), self._providers))
print("Falling back to {} and retrying.".format(self._fallback_providers))
self.set_providers(self._fallback_providers)
# Fallback only once.
self.disable_fallback()
return self._sess.run(output_names, input_feed, run_options)
And it fails at node 'Add_1514' which looks like this:
Any help of how I could tackle this problem would be appreciated. In the end I want to convert ONNX to TRT and run inference on triton server, but I need dynamic input shapes so I could pass different size images.
Hello, I've seen other people deal with similar issue, but unable to find the solution to it. I've converted Darknet model => ONNX using
demo_darknet2onnx.py
file. My export function looks like this:And I end up with such
model.onnx
file:However inference only works with model (height, width) - in this case image with shape=1x3x2976x64. Anything else (ex.: shape=1x3x992x64) results in:
outputs = session.run(['boxes', 'confs'], {'input': img_in})
return self._sess.run(output_names, input_feed, run_options)
onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Non-zero status code returned while running Add node. Name:'Add_1514' Status Message: D:\a\_work\1\s\onnxruntime\core/providers/cpu/math/element_wise_ops.h:505 onnxruntime::BroadcastIterator::Append axis == 1 || axis == largest was false. Attempting to broadcast an axis by a dimension other than 1. 2 by 93
I understand that this part of code fails as stated in error:And it fails at node 'Add_1514' which looks like this:
I run inference:
where img_in is:![image](https://user-images.githubusercontent.com/72936154/148388231-dc3ab8a2-25e9-4a3a-971a-1d516bf9504f.png)
Any help of how I could tackle this problem would be appreciated. In the end I want to convert ONNX to TRT and run inference on triton server, but I need dynamic input shapes so I could pass different size images.