diff --git a/modules/dnn/src/onnx/onnx_importer.cpp b/modules/dnn/src/onnx/onnx_importer.cpp index 79c7e29d1b2948dfe767bcd8a3ecd5f5b1670017..9f7895c7ddc1a76a37b0ba66d0b9f0e5b001488c 100644 --- a/modules/dnn/src/onnx/onnx_importer.cpp +++ b/modules/dnn/src/onnx/onnx_importer.cpp @@ -930,6 +930,14 @@ void ONNXImporter::parseBias(LayerParams& layerParams, const opencv_onnx::NodePr opencv_onnx::NodeProto node_proto = node_proto_; const std::string& layer_type = node_proto.op_type(); bool isSub = layer_type == "Sub"; + + if (layer_type == "Sum" && node_proto.input_size() == 1) + { + layerParams.type = "Identity"; + addLayer(layerParams, node_proto); + return; + } + CV_Assert((node_proto.input_size() == 2) || (layer_type == "Sum" && node_proto.input_size() > 2)); if (layer_type == "Sum" && node_proto.input_size() > 2)