From 27a6be8763d766c7de08c9402f6d13cdf28034a5 Mon Sep 17 00:00:00 2001 From: Dmitry Kurtaev Date: Tue, 4 Sep 2018 17:48:52 +0300 Subject: [PATCH] Fix #12407 --- modules/dnn/src/dnn.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/dnn/src/dnn.cpp b/modules/dnn/src/dnn.cpp index 214ac9961b..fb65da2a89 100644 --- a/modules/dnn/src/dnn.cpp +++ b/modules/dnn/src/dnn.cpp @@ -2692,8 +2692,7 @@ void Net::setInput(InputArray blob, const String& name, double scalefactor, cons Mat Net::getParam(LayerId layer, int numParam) { LayerData &ld = impl->getLayerData(layer); - - std::vector &layerBlobs = ld.layerInstance->blobs; + std::vector &layerBlobs = ld.getLayerInstance()->blobs; CV_Assert(numParam < (int)layerBlobs.size()); return layerBlobs[numParam]; } @@ -2702,7 +2701,7 @@ void Net::setParam(LayerId layer, int numParam, const Mat &blob) { LayerData &ld = impl->getLayerData(layer); - std::vector &layerBlobs = ld.layerInstance->blobs; + std::vector &layerBlobs = ld.getLayerInstance()->blobs; CV_Assert(numParam < (int)layerBlobs.size()); //we don't make strong checks, use this function carefully layerBlobs[numParam] = blob;