From 911651ebd591184c8fb25c40ac6b9c6518613628 Mon Sep 17 00:00:00 2001 From: wangguanzhong Date: Thu, 30 Jul 2020 20:48:40 +0800 Subject: [PATCH] fix_mobilenetv3_rcnn (#1130) --- ppdet/modeling/backbones/mobilenet_v3.py | 25 +++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/ppdet/modeling/backbones/mobilenet_v3.py b/ppdet/modeling/backbones/mobilenet_v3.py index 2b0b309ff..d4727449a 100644 --- a/ppdet/modeling/backbones/mobilenet_v3.py +++ b/ppdet/modeling/backbones/mobilenet_v3.py @@ -68,6 +68,9 @@ class MobileNetV3(object): if isinstance(feature_maps, Integral): feature_maps = [feature_maps] + if norm_type == 'sync_bn' and freeze_norm: + raise ValueError( + "The norm_type should not be sync_bn when freeze_norm is True") self.scale = scale self.model_name = model_name self.feature_maps = feature_maps @@ -437,16 +440,15 @@ class MobileNetV3(object): @register class MobileNetV3RCNN(MobileNetV3): - def __init__( - self, - scale=1.0, - model_name='large', - conv_decay=0.0, - norm_type='bn', - norm_decay=0.0, - freeze_norm=True, - feature_maps=[2, 3, 4, 5], - lr_mult_list=[1.0, 1.0, 1.0, 1.0, 1.0], ): + def __init__(self, + scale=1.0, + model_name='large', + conv_decay=0.0, + norm_type='bn', + norm_decay=0.0, + freeze_norm=True, + feature_maps=[2, 3, 4, 5], + lr_mult_list=[1.0, 1.0, 1.0, 1.0, 1.0]): super(MobileNetV3RCNN, self).__init__( scale=scale, model_name=model_name, @@ -454,7 +456,8 @@ class MobileNetV3RCNN(MobileNetV3): norm_type=norm_type, norm_decay=norm_decay, lr_mult_list=lr_mult_list, - feature_maps=feature_maps) + feature_maps=feature_maps, + freeze_norm=freeze_norm) self.curr_stage = 0 self.block_stride = 1 -- GitLab