From cf477f7e9faac694c404472274aa9b5b0c6f7627 Mon Sep 17 00:00:00 2001 From: Liubov Batanina Date: Tue, 24 Dec 2019 16:42:00 +0300 Subject: [PATCH] Fix global axis --- modules/dnn/src/layers/pooling_layer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/dnn/src/layers/pooling_layer.cpp b/modules/dnn/src/layers/pooling_layer.cpp index c4b452c5ac..55abcec0bf 100644 --- a/modules/dnn/src/layers/pooling_layer.cpp +++ b/modules/dnn/src/layers/pooling_layer.cpp @@ -95,8 +95,6 @@ public: else CV_Error(Error::StsBadArg, "Unknown pooling type \"" + pool + "\""); - global_axis = params.has("global_axis") ? params.get("global_axis") : -1; - getPoolingKernelParams(params, kernel_size, globalPooling, pads_begin, pads_end, strides, padMode); if (kernel_size.size() == 2) { kernel = Size(kernel_size[1], kernel_size[0]); @@ -126,6 +124,7 @@ public: CV_Error(Error::StsBadArg, "Cannot determine pooling type"); setParamsFrom(params); ceilMode = params.get("ceil_mode", true); + global_axis = params.get("global_axis", -1); spatialScale = params.get("spatial_scale", 1); avePoolPaddedArea = params.get("ave_pool_padded_area", true); }