TrojanXu / yolov5-tensorrt

A tensorrt implementation of yolov5: https://github.com/ultralytics/yolov5
Apache License 2.0
190 stars 46 forks source link

onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION #48

Open wangyongpenga opened 3 years ago

wangyongpenga commented 3 years ago

Traceback (most recent call last): File "/yolov5-tensorrt/main.py", line 375, in simplify_onnx(onnx_path) File "/yolov5-tensorrt/main.py", line 156, in simplify_onnx model_simp, check = simplify(model) File "/root/anaconda3/lib/python3.7/site-packages/onnxsim/onnx_simplifier.py", line 492, in simplify model = fixed_point(model, infer_shapes_and_optimize, constant_folding) File "/root/anaconda3/lib/python3.7/site-packages/onnxsim/onnx_simplifier.py", line 393, in fixed_point x = func_b(x) File "/root/anaconda3/lib/python3.7/site-packages/onnxsim/onnx_simplifier.py", line 486, in constant_folding custom_lib=custom_lib) File "/root/anaconda3/lib/python3.7/site-packages/onnxsim/onnx_simplifier.py", line 232, in forward_for_node_outputs custom_lib=custom_lib) File "/root/anaconda3/lib/python3.7/site-packages/onnxsim/onnx_simplifier.py", line 216, in forward outputs, inputs, run_options=run_options))) File "/root/anaconda3/lib/python3.7/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 188, 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 Mul node. Name:'Mul_448' Status Message: /onnxruntime_src/onnxruntime/core/providers/cpu/math/element_wise_ops.h:487 void onnxruntime::BroadcastIterator::Append(ptrdiff_t, ptrdiff_t) axis == 1 || axis == largest was false. Attempting to broadcast an axis by a dimension other than 1. 3 by 16

DavidPaw commented 3 years ago

same problem

DavidPaw commented 3 years ago

@wangyongpenga I solved this problem by roll back versions of tensorrt. This environment is work for me: cuda==10.2 cudnn==8.0.5 tensorRT==7.1.3.4 torch==1.6.0 onnx==1.6.0 onnxruntime==1.2.0