From 33896dcf4a38247805a299ec279efbd3eaeea2bd Mon Sep 17 00:00:00 2001 From: FlyingQianMM <245467267@qq.com> Date: Wed, 12 Aug 2020 16:05:39 +0800 Subject: [PATCH] fix coco pretrained weight setting error for deeplabv3p_mobilenetv3_large_ssld --- paddlex/cv/models/utils/pretrain_weights.py | 6 +++--- paddlex/cv/nets/mobilenet_v3.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/paddlex/cv/models/utils/pretrain_weights.py b/paddlex/cv/models/utils/pretrain_weights.py index b865cc7..cd8213c 100644 --- a/paddlex/cv/models/utils/pretrain_weights.py +++ b/paddlex/cv/models/utils/pretrain_weights.py @@ -146,7 +146,8 @@ def get_pretrain_weights(flag, class_name, backbone, save_dir): if flag == 'COCO': if class_name == 'DeepLabv3p' and backbone in [ 'Xception41', 'MobileNetV2_x0.25', 'MobileNetV2_x0.5', - 'MobileNetV2_x1.5', 'MobileNetV2_x2.0' + 'MobileNetV2_x1.5', 'MobileNetV2_x2.0', + 'MobileNetV3_large_x1_0_ssld' ]: model_name = '{}_{}'.format(class_name, backbone) logging.warning(warning_info.format(model_name, flag, 'IMAGENET')) @@ -169,8 +170,7 @@ def get_pretrain_weights(flag, class_name, backbone, save_dir): flag = 'IMAGENET' if class_name == 'DeepLabv3p' and backbone in [ 'Xception41', 'MobileNetV2_x0.25', 'MobileNetV2_x0.5', - 'MobileNetV2_x1.5', 'MobileNetV2_x2.0', - 'MobileNetV3_large_x1_0_ssld' + 'MobileNetV2_x1.5', 'MobileNetV2_x2.0' ]: model_name = '{}_{}'.format(class_name, backbone) logging.warning(warning_info.format(model_name, flag, 'IMAGENET')) diff --git a/paddlex/cv/nets/mobilenet_v3.py b/paddlex/cv/nets/mobilenet_v3.py index 750692b..67a43bf 100644 --- a/paddlex/cv/nets/mobilenet_v3.py +++ b/paddlex/cv/nets/mobilenet_v3.py @@ -150,7 +150,8 @@ class MobileNetV3(): else: raise NotImplementedError - self.modify_bottle_params(output_stride) + if self.for_seg: + self.modify_bottle_params(output_stride) def modify_bottle_params(self, output_stride=None): if output_stride is not None and output_stride % 2 != 0: -- GitLab