shouxieai / tensorRT_Pro

C++ library based on tensorrt integration
MIT License
2.55k stars 543 forks source link

win10,yolov5-6.0版本转换成onnx,编译调试报错如下: #156

Open hanyong-max opened 1 year ago

hanyong-max commented 1 year ago

[2022-09-25 08:10:04][info][app_yolo.cpp:132]:===================== test YoloV5 FP32 yolov5s6 ================================== [2022-09-25 08:10:04][info][trt_builder.cpp:474]:Compile FP32 Onnx Model 'yolov5s6.onnx'. [2022-09-25 08:10:07][error][trt_builder.cpp:30]:NVInfer: C:\Users\17243\Desktop\tensorRT_Pro-main\windows\src\tensorRT\onnx_parser\ModelImporter.cpp:736: While parsing node number 143 [Resize -> "onnx::Concat_271"]: [2022-09-25 08:10:07][error][trt_builder.cpp:30]:NVInfer: C:\Users\17243\Desktop\tensorRT_Pro-main\windows\src\tensorRT\onnx_parser\ModelImporter.cpp:737: --- Begin node --- [2022-09-25 08:10:07][error][trt_builder.cpp:30]:NVInfer: C:\Users\17243\Desktop\tensorRT_Pro-main\windows\src\tensorRT\onnx_parser\ModelImporter.cpp:738: input: "input.140" input: "onnx::Resize_270" input: "onnx::Resize_460" output: "onnx::Concat_271" name: "Resize_143" op_type: "Resize" attribute { name: "coordinate_transformation_mode" s: "asymmetric" type: STRING } attribute { name: "cubic_coeff_a" f: -0.75 type: FLOAT } attribute { name: "mode" s: "nearest" type: STRING } attribute { name: "nearest_mode" s: "floor" type: STRING }

[2022-09-25 08:10:07][error][trt_builder.cpp:30]:NVInfer: C:\Users\17243\Desktop\tensorRT_Pro-main\windows\src\tensorRT\onnx_parser\ModelImporter.cpp:739: --- End node --- [2022-09-25 08:10:07][error][trt_builder.cpp:30]:NVInfer: C:\Users\17243\Desktop\tensorRT_Pro-main\windows\src\tensorRT\onnx_parser\ModelImporter.cpp:742: ERROR: C:\Users\17243\Desktop\tensorRT_Pro-main\windows\src\tensorRT\onnx_parser\builtin_op_importers.cpp:3500 In function importResize: [8] Assertion failed: scales.is_weights() && "Resize scales must be an initializer!" [2022-09-25 08:10:07][error][trt_builder.cpp:519]:Can not parse OnnX file: yolov5s6.onnx [2022-09-25 08:10:07][error][yolo.cpp:192]:Engine yolov5s6.FP32.trtmodel load failed [2022-09-25 08:10:07][error][app_yolo.cpp:52]:Engine is nullptr

期待您的回复

shouxieai commented 1 year ago

你需要降低pytorch版本,比如1.10

SunYiLing123 commented 1 year ago

Thanks