Skip to content

When exporting RFDETRSegPreview using export_onnx(), "masks" not added to output_names. #401

@Abdul-Mukit

Description

@Abdul-Mukit

Search before asking

  • I have searched the RF-DETR issues and found no similar bug report.

Bug

When exporting RFDETRSegPreview model, the output_names doesn't contain "masks" in

output_names = ['features'] if backbone_only else ['dets', 'labels']

When inspecting intput/output details of exported ONNX model we get 4245 instead of getting masks:

Successfully exported ONNX model: output/inference_model.onnx
Successfully exported ONNX model to: output/inference_model.onnx
ONNX export completed successfully
ONNX input details: 
input [1, 3, 432, 432] tensor(float)
ONNX output details: 
dets [1, 200, 4] tensor(float)
labels [1, 200, 91] tensor(float)
4245 [1, 200, 108, 108] tensor(float)

Expected:

ONNX output details: 
dets [1, 200, 4] tensor(float)
labels [1, 200, 91] tensor(float)
masks [1, 200, 108, 108] tensor(float)

Environment

  • RF-DETR: 1.3.0

Minimal Reproducible Example

Run the following code in a ipython terminal or a Python script.

from rfdetr import RFDETRSegPreview
import onnxruntime as ort

model = RFDETRSegPreview()
model.export(verbose=False)

session = ort.InferenceSession("output/inference_model.onnx")

inputs = session.get_inputs()
print("ONNX input details: ")
for input in inputs:
    print(input.name, input.shape, input.type)

print("ONNX output details: ")
outputs = session.get_outputs()
for output in outputs:
    print(output.name, output.shape, output.type)

Additional

No response

Are you willing to submit a PR?

  • Yes, I'd like to help by submitting a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions