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.61k stars 303 forks source link

Export to engine #441

Open TtopsBo opened 2 months ago

TtopsBo commented 2 months ago

Star RTDETR 请先在RTDETR主页点击star以支持本项目 Star RTDETR to help more people discover this project.


Describe the bug 使用tensorRT 10.3导出engine时,报错 [08/30/2024-23:44:34] [I] [TRT] No checker registered for op: EfficientNMS_TRT. Attempting to check as plugin. [08/30/2024-23:44:34] [I] [TRT] No importer registered for op: EfficientNMS_TRT. Attempting to import as plugin. [08/30/2024-23:44:34] [I] [TRT] Searching for plugin: EfficientNMS_TRT, plugin_version: 1, plugin_namespace: [08/30/2024-23:44:34] [I] [TRT] Successfully created plugin: EfficientNMS_TRT [08/30/2024-23:44:34] [I] Finished parsing network model. Parse time: 0.16514 &&&& FAILED TensorRT.trtexec [TensorRT v100300] # trtexec --onnx=yolo_w_nms.onnx --saveEngine=rt_detr.engine --fp16 [08/30/2024-23:44:34] [W] [TRT] ModelImporter.cpp:420: Make sure input orig_target_sizes has Int64 binding. [08/30/2024-23:44:34] [W] [TRT] onnxOpImporters.cpp:6119: Attribute class_agnostic not found in plugin node! Ensure that the plugin creator has a default value defined or the engine may fail to build. [08/30/2024-23:44:34] [E] [TRT] ModelImporter.cpp:954: ERROR: ModelImporter.cpp:792 In function importModel: [8] Assertion failed: (output_tensor_ptr->getType() != nvinfer1::DataType::kINT32 || output_trt_dtype == nvinfer1::DataType::kINT32) && "For INT32 tensors, the output type must also be INT32." [08/30/2024-23:44:34] [E] Failed to parse onnx file [08/30/2024-23:44:34] [E] Parsing model failed [08/30/2024-23:44:34] [E] Failed to create engine from model or file. [08/30/2024-23:44:34] [E] Engine set up failed

使用Netron检查时,最后输出维度含有?。 image 使用的是Custom dataset。 能使用训练后的pth->onnx->engine吗? To Reproduce latest.pth->onnx->engine 代码如下 from utils import yolo_insert_nms yolo_insert_nms('D:/RT-DETR R18/model/model.onnx') !trtexec --onnx=yolo_w_nms.onnx --saveEngine=rt_detr.engine --fp16