diff --git a/paddlex/cv/models/faster_rcnn.py b/paddlex/cv/models/faster_rcnn.py index 86d21dbe8cc841f766b65a571baf8d7807598aa6..1b7320552ca04e7e1ade514ceee999d789391183 100644 --- a/paddlex/cv/models/faster_rcnn.py +++ b/paddlex/cv/models/faster_rcnn.py @@ -79,8 +79,6 @@ class FasterRCNN(BaseAPI): layers = 50 variant = 'd' norm_type = 'affine_channel' - if self.bbox_loss_type != 'SmoothL1Loss': - norm_type = 'bn' elif backbone_name == 'ResNet101': layers = 101 variant = 'b' @@ -89,14 +87,15 @@ class FasterRCNN(BaseAPI): layers = 101 variant = 'd' norm_type = 'affine_channel' - if self.bbox_loss_type != 'SmoothL1Loss': - norm_type = 'bn' elif backbone_name == 'HRNet_W18': backbone = paddlex.cv.nets.hrnet.HRNet( width=18, freeze_norm=True, norm_decay=0., freeze_at=0) if self.with_fpn is False: self.with_fpn = True return backbone + if backbone_name.startswith('ResNet'): + if self.bbox_loss_type != 'SmoothL1Loss': + norm_type = 'bn' if self.with_fpn: backbone = paddlex.cv.nets.resnet.ResNet( norm_type='bn' if norm_type is None else norm_type,