From cd53144ed344f0283088014f13dd98a7da03906d Mon Sep 17 00:00:00 2001 From: "ashishiva3@gmail.com" Date: Sat, 1 Feb 2020 00:40:03 +0530 Subject: [PATCH] commit: Corrected end tensor_content parsing for StridedSlice layer. --- modules/dnn/src/tensorflow/tf_importer.cpp | 2 ++ modules/dnn/test/test_tf_importer.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/modules/dnn/src/tensorflow/tf_importer.cpp b/modules/dnn/src/tensorflow/tf_importer.cpp index 2775934faf..2d2fc51ced 100644 --- a/modules/dnn/src/tensorflow/tf_importer.cpp +++ b/modules/dnn/src/tensorflow/tf_importer.cpp @@ -1468,6 +1468,8 @@ void TFImporter::populateNet(Net dstNet) int end_mask = getLayerAttr(layer, "end_mask").i(); for (int i = 0; i < num; ++i) { + if (ends.at(i) < 0) + ends.at(i) -= 1; if (end_mask & (1 << i)) ends.at(i) = -1; if (strides.at(i) != 1) diff --git a/modules/dnn/test/test_tf_importer.cpp b/modules/dnn/test/test_tf_importer.cpp index 54da723973..2445d78c29 100644 --- a/modules/dnn/test/test_tf_importer.cpp +++ b/modules/dnn/test/test_tf_importer.cpp @@ -756,6 +756,8 @@ TEST_P(Test_TensorFlow_layers, slice) (target == DNN_TARGET_OPENCL || target == DNN_TARGET_OPENCL_FP16)) applyTestTag(target == DNN_TARGET_OPENCL ? CV_TEST_TAG_DNN_SKIP_IE_OPENCL : CV_TEST_TAG_DNN_SKIP_IE_OPENCL_FP16, CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER); + double l1 = target == DNN_TARGET_MYRIAD ? 4.9e-3 : default_l1; + runTensorFlowNet("crop2d", false, l1); runTensorFlowNet("slice_4d"); runTensorFlowNet("strided_slice"); }