From 3fe0f60dba9ea0b06584891e4b466831936bdad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=88=A9=E9=9C=9E?= Date: Mon, 28 Mar 2022 02:16:38 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9B=BF=E6=8D=A2dropout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DeepLabv3+_ID0147_for_TensorFlow/deeplab/model.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/TensorFlow/built-in/cv/image_segmentation/DeepLabv3+out_ID0147_for_TensorFlow/DeepLabv3+_ID0147_for_TensorFlow/deeplab/model.py b/TensorFlow/built-in/cv/image_segmentation/DeepLabv3+out_ID0147_for_TensorFlow/DeepLabv3+_ID0147_for_TensorFlow/deeplab/model.py index 311aaa1ac..e887c3cb0 100644 --- a/TensorFlow/built-in/cv/image_segmentation/DeepLabv3+out_ID0147_for_TensorFlow/DeepLabv3+_ID0147_for_TensorFlow/deeplab/model.py +++ b/TensorFlow/built-in/cv/image_segmentation/DeepLabv3+out_ID0147_for_TensorFlow/DeepLabv3+_ID0147_for_TensorFlow/deeplab/model.py @@ -529,11 +529,12 @@ def extract_features(images, if model_options.aspp_with_concat_projection: concat_logits = slim.conv2d( concat_logits, depth, 1, scope=CONCAT_PROJECTION_SCOPE) - concat_logits = slim.dropout( - concat_logits, - keep_prob=0.9, - is_training=is_training, - scope=CONCAT_PROJECTION_SCOPE + '_dropout') + if is_training: + concat_logits = npu_ops.dropout( + concat_logits, + keep_prob=0.9, + name=CONCAT_PROJECTION_SCOPE + '_dropout' + ) if (model_options.add_image_level_feature and model_options.aspp_with_squeeze_and_excitation): concat_logits *= image_feature -- Gitee From 33575ad69220ba886eb46f25bad34855c42ba6d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=88=A9=E9=9C=9E?= Date: Mon, 28 Mar 2022 03:48:43 +0000 Subject: [PATCH 2/3] add import --- .../DeepLabv3+_ID0147_for_TensorFlow/deeplab/model.py | 1 + 1 file changed, 1 insertion(+) diff --git a/TensorFlow/built-in/cv/image_segmentation/DeepLabv3+out_ID0147_for_TensorFlow/DeepLabv3+_ID0147_for_TensorFlow/deeplab/model.py b/TensorFlow/built-in/cv/image_segmentation/DeepLabv3+out_ID0147_for_TensorFlow/DeepLabv3+_ID0147_for_TensorFlow/deeplab/model.py index e887c3cb0..0656849be 100644 --- a/TensorFlow/built-in/cv/image_segmentation/DeepLabv3+out_ID0147_for_TensorFlow/DeepLabv3+_ID0147_for_TensorFlow/deeplab/model.py +++ b/TensorFlow/built-in/cv/image_segmentation/DeepLabv3+out_ID0147_for_TensorFlow/DeepLabv3+_ID0147_for_TensorFlow/deeplab/model.py @@ -57,6 +57,7 @@ from tensorflow.contrib import slim as contrib_slim from deeplab.core import dense_prediction_cell from deeplab.core import feature_extractor from deeplab.core import utils +from npu_bridge.npu_init import * slim = contrib_slim -- Gitee From 1a0c8dca5675a85f2389475c58656f57f26f76db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=88=A9=E9=9C=9E?= Date: Mon, 28 Mar 2022 07:10:23 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9B=BF=E6=8D=A2dropout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DeepLabv3+_ID0147_for_TensorFlow/deeplab/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TensorFlow/built-in/cv/image_segmentation/DeepLabv3+out_ID0147_for_TensorFlow/DeepLabv3+_ID0147_for_TensorFlow/deeplab/model.py b/TensorFlow/built-in/cv/image_segmentation/DeepLabv3+out_ID0147_for_TensorFlow/DeepLabv3+_ID0147_for_TensorFlow/deeplab/model.py index 0656849be..4f2f87c2f 100644 --- a/TensorFlow/built-in/cv/image_segmentation/DeepLabv3+out_ID0147_for_TensorFlow/DeepLabv3+_ID0147_for_TensorFlow/deeplab/model.py +++ b/TensorFlow/built-in/cv/image_segmentation/DeepLabv3+out_ID0147_for_TensorFlow/DeepLabv3+_ID0147_for_TensorFlow/deeplab/model.py @@ -530,7 +530,7 @@ def extract_features(images, if model_options.aspp_with_concat_projection: concat_logits = slim.conv2d( concat_logits, depth, 1, scope=CONCAT_PROJECTION_SCOPE) - if is_training: + if is_training: concat_logits = npu_ops.dropout( concat_logits, keep_prob=0.9, -- Gitee