diff --git a/modules/dnn/src/dnn.cpp b/modules/dnn/src/dnn.cpp index 7c4950eb9255..3c10db6b8aa8 100644 --- a/modules/dnn/src/dnn.cpp +++ b/modules/dnn/src/dnn.cpp @@ -4976,9 +4976,7 @@ void Net::setInput(InputArray blob, const String& name, double scalefactor, cons MatShape prevShape = shape(impl->netInputLayer->inputsData[pin.oid]); bool oldShape = prevShape == blobShape; - // blob_.copyTo(impl->netInputLayer->inputsData[pin.oid]); - impl->netInputLayer->inputsData.emplace(impl->netInputLayer->inputsData.begin()+pin.oid, blob_); - impl->netInputLayer->inputsData.erase(impl->netInputLayer->inputsData.begin()+pin.oid+1); + blob_.copyTo(impl->nPetInputLayer->inputsData[pin.oid]); if (!oldShape) { ld.outputBlobs[pin.oid] = impl->netInputLayer->inputsData[pin.oid]; if (impl->hasDynamicShapes)