yhwang-hub/yolov5_QAT

YOLOv5s PQT - trtexec export failure

Closed this issue · 1 comments

Hi there,
Thanks for sharing your work, I'm trying to replicate your steps working inside your container image longxiaowyh/yolov5:v2.0.
After the PQT calibration step I got the following accuracy results:

Class Images Instances P R mAP50 mAP50-95:
  all     5000 36335 0.668 0.508 0.556 0.364

Then I tried to convert the onnx weight to the trt engine using

trtexec --onnx=ptq_yolov5.onnx --saveEngine=ptq_yolov5.engine --int8 --fp16

I get the following error from trtexec:

[02/28/2024-21:29:20] [E] Error[3]: onnx::QuantizeLinear_1450: invalid weights type of Int8
[02/28/2024-21:29:20] [E] [TRT] parsers/onnx/ModelImporter.cpp:773: While parsing node number 3 [Identity -> "onnx::QuantizeLinear_1462"]:
[02/28/2024-21:29:20] [E] [TRT] parsers/onnx/ModelImporter.cpp:774: --- Begin node ---
[02/28/2024-21:29:20] [E] [TRT] parsers/onnx/ModelImporter.cpp:775: input: "onnx::QuantizeLinear_1450"
output: "onnx::QuantizeLinear_1462"
name: "Identity_3"
op_type: "Identity"
[02/28/2024-21:29:20] [E] [TRT] parsers/onnx/ModelImporter.cpp:776: --- End node ---
[02/28/2024-21:29:20] [E] [TRT] parsers/onnx/ModelImporter.cpp:778: ERROR: parsers/onnx/ModelImporter.cpp:180 In function parseGraph:
[6] Invalid Node - Identity_3

Do you have any idea what that might depend on?
Thank you

You can refer to the repo https://github.com/yhwang-hub/yolov7_QAT to export the tensorrt model.