From 608968aa83a1c802009fc4157bf2f343b8f08c31 Mon Sep 17 00:00:00 2001 From: Li Peng Date: Fri, 23 Feb 2018 18:25:12 +0800 Subject: [PATCH] Deconvolution ocl fix Signed-off-by: Li Peng --- modules/dnn/src/layers/convolution_layer.cpp | 4 ++-- modules/dnn/test/test_tf_importer.cpp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/dnn/src/layers/convolution_layer.cpp b/modules/dnn/src/layers/convolution_layer.cpp index 3250501468..40681c963f 100644 --- a/modules/dnn/src/layers/convolution_layer.cpp +++ b/modules/dnn/src/layers/convolution_layer.cpp @@ -1390,8 +1390,8 @@ public: { int total = outGroupCn * decnBlob.cols; int index = 0; - int height_col = (outH + 2 * pad.height - kernel.height) / stride.height + 1; - int width_col = (outW + 2 * pad.width - kernel.width) / stride.width + 1; + int height_col = inpH; + int width_col = inpW; int coeff_h = (1 - stride.height * kernel.width * height_col) * width_col; int coeff_w = (1 - stride.width * height_col * width_col); diff --git a/modules/dnn/test/test_tf_importer.cpp b/modules/dnn/test/test_tf_importer.cpp index 35412041a6..cfa66de3b1 100644 --- a/modules/dnn/test/test_tf_importer.cpp +++ b/modules/dnn/test/test_tf_importer.cpp @@ -181,6 +181,10 @@ TEST(Test_TensorFlow, deconvolution) OCL_TEST(Test_TensorFlow, deconvolution) { runTensorFlowNet("deconvolution", DNN_TARGET_OPENCL); + runTensorFlowNet("deconvolution_same", DNN_TARGET_OPENCL); + runTensorFlowNet("deconvolution_stride_2_same", DNN_TARGET_OPENCL); + runTensorFlowNet("deconvolution_adj_pad_valid", DNN_TARGET_OPENCL); + runTensorFlowNet("deconvolution_adj_pad_same", DNN_TARGET_OPENCL); } TEST(Test_TensorFlow, matmul) -- GitLab