engine infer null of TensorRT 10.13.2.6 when running Detectron2->onnx->engine, on GPU 12.8
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 13.4k
- Forks
- 2.4k
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 2
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the sample files under samples/python/detectron2 and the reported entry points create_onnx.py, build_engine.py, and infer.py, then reproduce the conversion and inference commands with the listed environment. Compare the engine outputs with the Detectron2 result; done means the TensorRT engine produces non-empty results for the supplied image or the failure is narrowed to a specific conversion or inference step.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100