From 4384e77bd1b9930c9424667d3c408c663a19c7d7 Mon Sep 17 00:00:00 2001 From: zihaomu Date: Wed, 24 May 2023 21:57:59 +0800 Subject: [PATCH] when stride ==0, it should be bug --- modules/dnn/src/layers/cpu_kernels/convolution.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/dnn/src/layers/cpu_kernels/convolution.cpp b/modules/dnn/src/layers/cpu_kernels/convolution.cpp index 3297374fed..0b666a855d 100644 --- a/modules/dnn/src/layers/cpu_kernels/convolution.cpp +++ b/modules/dnn/src/layers/cpu_kernels/convolution.cpp @@ -54,8 +54,8 @@ Ptr initFastConv( conv->pad_bottom = conv_dim == CONV_1D ? 0 : (int)pads_end[pads_end.size() - 2]; conv->pad_right = (int)pads_end.back(); - int stride_d = conv_dim == CONV_3D ? (int)strides[0] : 0; - int stride_h = conv_dim == CONV_1D ? 0 : (int)strides[strides.size() - 2]; + int stride_d = conv_dim == CONV_3D ? (int)strides[0] : 1; + int stride_h = conv_dim == CONV_1D ? 1 : (int)strides[strides.size() - 2]; int stride_w = (int)strides.back(); int dilation_d = conv_dim == CONV_3D ? (int)dilations[0] : 1;