Skip to content

engine infer null of TensorRT 10.13.2.6 when running Detectron2->onnx->engine, on GPU 12.8 #4566

@guwuyue

Description

@guwuyue

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

  1. 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
  2. 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
  3. 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
Image
  • 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
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions