Traceback (most recent call last): File "models/export_cfg.py", line 1109, in <module> main(cfg_file=args.cfg_file, weights_file=args.weights_file, output_file=args.output_file, strides=args.strides, File "models/export_cfg.py", line 1099, in main onnx_test(onnx_model) File "models/export_cfg.py", line 1084, in onnx_test ort_outs_rand = ort_session.run(None, ort_inputs_rand) File "C:\Users\siria\.conda\envs\scaledyolov4\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 192, in run 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 Reshape node. Name:'' Status Message: D:\a\_work\1\s\onnxruntime\core\providers\cpu\tensor\reshape_helper.h:42 onnxruntime::ReshapeHelper::ReshapeHelper gsl::narrow_cast<int64_t>(input_shape.Size()) == size was false. The input tensor cannot be reshaped to the requested shape. Input shape:{1,255,13,13}, requested shape:{1,3,85,52,52}
I tried the same procedure with yolo csp with no problems. Any idea? Thanks in advance.
I have successfully converted yolo tiny to ONNX. Using the .cfg file https://github.com/WongKinYiu/ScaledYOLOv4/blob/yolov4-tiny/cfg/yolov4-tiny.cfg and the export.py code here https://github.com/linghu8812/tensorrt_inference/blob/master/Yolov4/export_onnx.py. The problem comes when I try to test the model using this code
`def onnx_test(onnx_model):
It gives the following:
Traceback (most recent call last): File "models/export_cfg.py", line 1109, in <module> main(cfg_file=args.cfg_file, weights_file=args.weights_file, output_file=args.output_file, strides=args.strides, File "models/export_cfg.py", line 1099, in main onnx_test(onnx_model) File "models/export_cfg.py", line 1084, in onnx_test ort_outs_rand = ort_session.run(None, ort_inputs_rand) File "C:\Users\siria\.conda\envs\scaledyolov4\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 192, in run 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 Reshape node. Name:'' Status Message: D:\a\_work\1\s\onnxruntime\core\providers\cpu\tensor\reshape_helper.h:42 onnxruntime::ReshapeHelper::ReshapeHelper gsl::narrow_cast<int64_t>(input_shape.Size()) == size was false. The input tensor cannot be reshaped to the requested shape. Input shape:{1,255,13,13}, requested shape:{1,3,85,52,52}
I tried the same procedure with yolo csp with no problems. Any idea? Thanks in advance.