yangjun dfa27afb39 提交PaddleDetection develop 分支 d56cf3f7c294a7138013dac21f87da4ea6bee829 | 1 yıl önce | |
---|---|---|
.. | ||
README.md | 1 yıl önce | |
onnx_custom.py | 1 yıl önce | |
preprocess.py | 1 yıl önce | |
trt_infer.py | 1 yıl önce |
本教程内容为:使用PP-YOLOE模型导出转换为ONNX格式,并定制化修改网络,使用EfficientNMS_TRT OP, 可成功运行在TensorRT上,示例仅供参考
CUDA 10.2 + cudnn 8.2.1 + TensorRT 8.2
onnx
onnxruntime
paddle2onnx
python tools/export_model.py -c configs/ppyoloe/ppyoloe_crn_l_300e_coco.yml -o weights=https://paddledet.bj.bcebos.com/models/ppyoloe_crn_l_300e_coco.pdparams trt=True exclude_nms=True
python deploy/third_engine/demo_onnx_trt/onnx_custom.py --onnx_file=output_inference/ppyoloe_crn_l_300e_coco/ppyoloe_crn_l_300e_coco.onnx --model_dir=output_inference/ppyoloe_crn_l_300e_coco/ --opset_version=11
trtexec --onnx=output_inference/ppyoloe_crn_l_300e_coco/ppyoloe_crn_l_300e_coco.onnx --saveEngine=ppyoloe_crn_l_300e_coco.engine
注意:若运行报错,可尝试添加--tacticSources=-cublasLt,+cublas
参数解决
python deploy/third_engine/demo_onnx_trt/trt_infer.py --infer_cfg=output_inference/ppyoloe_crn_l_300e_coco/infer_cfg.yml --trt_engine=ppyoloe_crn_l_300e_coco.engine --image_file=demo/000000014439.jpg