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
@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
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