-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
Module:Engine BuildIssues with building TensorRT enginesIssues with building TensorRT engines
Description
Description
Following the steps in the URL (https://github.com/NVIDIA/TensorRT/tree/v10.13.2/samples/python/detectron2 and https://github.com/facebookresearch/detectron2), I converted Detectron2 to ONNX, then converted ONNX to an engine. When performing image inference using the engine, all results were empty.
Environment
TensorRT Version: 10.13.2.6
NVIDIA GPU: 5070Ti
NVIDIA Driver Version: 581.08
CUDA Version: 12.8.1
CUDNN Version: 9.10.2.21
Operating System:
Python Version (if applicable): 3.11
PyTorch Version (if applicable): 2.8.0+cu128
Relevant Files
https://github.com/NVIDIA/TensorRT/tree/v10.13.2/samples/python/detectron2
https://github.com/facebookresearch/detectron2
Model link: detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl
Steps To Reproduce
- Detectron 2 Deployment:
1.2. the Command: python /tools/deploy/export_model.py --sample-image tools/deploy/data/input.jpg --config-file configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml --export-method tracing --format onnx --output tools/deploy/output/ MODEL.WEIGHTS tools/deploy/pretrain_model/model_final_f10217.pkl MODEL.DEVICE cuda - Create ONNX Graph: python create_onnx.py --exported_onnx detectron2/tools/deploy/output/model.onnx --onnx detectron2/tools/deploy/output/converted.onnx --det2_config detectron2/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml --det2_weights detectron2/tools/deploy/pretrain_model/model_final_f10217.pkl --sample_image detectron2/tools/deploy/data/input.jpg
- Build TensorRT Engine: python build_engine.py --onnx detectron2/tools/deploy/output/converted.onnx --engine detectron2/tools/deploy/output/engine.trt --precision fp16
4.Inference in Python: python infer.py --engine detectron2/tools/deploy/output/engine.trt --input detectron2/tools/deploy/data/input.jpg --det2_config detectron2/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml --output detectron2/tools/deploy/output
onnx and engine files:
- the result of engine
- the result of Detectron2 infer: python demo.py --config-file configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml --input tools/deploy/data/image/*.jpg --output tools/deploy/output/pkl --opts MODEL.WEIGHTS
tools/deploy/pretrain_model/model_final_f10217.pkl

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Module:Engine BuildIssues with building TensorRT enginesIssues with building TensorRT engines