Skip to content

Inconsistent shape for ConcatLayer #1789

@AlexAkatyev

Description

@AlexAkatyev

Exception : Inconsistent shape for ConcatLayer

FuncName cv::dnn::ConcatLayerImpl::getMemoryShapes
D:\a\opencv_files\opencv_files\opencv\modules\dnn\src\layers\concat_layer.cpp

Example:

using OpenCvSharp.Dnn;

private Net? _net;
_net = CvDnn.ReadNetFromOnnx("C:\1\best.onnx");

OS Windows 11 x64

the model is obtained as follows:

from ultralytics import YOLO
model = YOLO('best.pt')
model.export(format='onnx',
batch=1,
device='cpu',
simplify=True,
imgsz=640,
dynamic=True)

Opencv developers claim that the bug is fixed in version 4.10 on May 20, 2024
opencv/opencv#25485

Loaded OpenCvSharp4 ver 4.11.0.20250507

there is a solution https://github.com/LaurentBerger/dnnlegacy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions