Skip to content

Commit 154380c

Browse files
committed
Merge pull request opencv#18234 from l-bat:onnx_reshape
2 parents f9fbd29 + 2349a09 commit 154380c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/dnn/src/onnx/onnx_importer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,10 @@ void ONNXImporter::populateNet(Net dstNet)
335335
{
336336
inpShape[j] = tensorShape.dim(j).dim_value();
337337
}
338+
if (!inpShape.empty())
339+
{
340+
inpShape[0] = std::max(inpShape[0], 1); // It's OK to have undetermined batch size
341+
}
338342
outShapes[valueInfoProto.name()] = inpShape;
339343
}
340344

0 commit comments

Comments
 (0)