lyuwenyu / RT-DETR

[CVPR 2024] Official RT-DETR (RTDETR paddle pytorch), Real-Time DEtection TRansformer, DETRs Beat YOLOs on Real-time Object Detection. 🔥 🔥 🔥
Apache License 2.0
2.18k stars 237 forks source link

RT-DETR量化后的模型是否可以转成tensorrt的模型格式 #343

Open zhDai opened 2 months ago

zhDai commented 2 months ago

转换的命令行如下: trtexec --onnx=rtdetr_hgnetv2_l_6x_coco_quant_dynamic.onnx --saveEngine=rtdetr_hgnetv2_l_6x_coco_quant_dynamic.engine --minShapes=images:1x3x640x640 --optShapes=images:16x3x640x640 --maxShapes=images:32x3x640x640 --shapes=images:16x3x640x640 --workspace=1024 --buildOnly

报错如下: [06/21/2024-17:30:57] [E] Error[3]: p2o.DequantizeLinear.1357: only activation types allowed as input to this layer. [06/21/2024-17:30:57] [E] [TRT] ModelImporter.cpp:771: While parsing node number 3294 [DequantizeLinear -> "p2o.DequantizeLinear.1358"]: [06/21/2024-17:30:57] [E] [TRT] ModelImporter.cpp:772: --- Begin node --- [06/21/2024-17:30:57] [E] [TRT] ModelImporter.cpp:773: input: "conv2d_0.w_0.merged.bias" input: "p2o.helper.constant.6000" input: "p2o.helper.constant.6001" output: "p2o.DequantizeLinear.1358" name: "p2o.DequantizeLinear.1357" op_type: "DequantizeLinear" attribute { name: "axis" i: 0 type: INT }

[06/21/2024-17:30:57] [E] [TRT] ModelImporter.cpp:774: --- End node --- [06/21/2024-17:30:57] [E] [TRT] ModelImporter.cpp:777: ERROR: ModelImporter.cpp:195 In function parseGraph: [6] Invalid Node - p2o.DequantizeLinear.1357 p2o.DequantizeLinear.1357: only activation types allowed as input to this layer. [06/21/2024-17:30:57] [E] Failed to parse onnx file [06/21/2024-17:30:57] [I] Finished parsing network model. Parse time: 0.257596 [06/21/2024-17:30:57] [E] Parsing model failed [06/21/2024-17:30:57] [E] Failed to create engine from model or file. [06/21/2024-17:30:57] [E] Engine set up failed

请问RT-DETR量化后的模型是否可以转成tensorrt的模型格式,比如engine或者trt

lyuwenyu commented 2 months ago

训练好的模型离线量化没问题;