Skip to content

The output size issue of the ONNX exported model #61

@jgy0

Description

@jgy0

Why does the output of the four types of detectors I trained, after exporting to ONNX, result in [1, 8, 33600], which does not conform to 1: batch size 9: 4(bbox) + 1(obj_conf) + 4(cls_conf) = 9?

for example

from ultralytics import YOLO
model = YOLO('/home/guangyao/code/yolov13/runs/detect/echinoderm43/weights/best.pt')
print('Model classes:', model.names)

output is Model classes: {0: 'starfish', 1: 'holothurian', 2: 'echinus', 3: 'scallop'}

import onnx
model = onnx.load('/home/guangyao/code/yolov13/runs/detect/echinoderm43/weights/best.onnx')
for i, output in enumerate(model.graph.output):
shape = [dim.dim_value for dim in output.type.tensor_type.shape.dim]
print(f'Output {i}: {shape}')

Output 0: [1, 8, 33600]

why?what's mean 8 and 33600

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions