From 29a5c2fa3e30c07610a41392f1963d2b3d0c0fe5 Mon Sep 17 00:00:00 2001 From: Wenyu Date: Mon, 20 Jun 2022 17:36:36 +0800 Subject: [PATCH] use bias (#6234) --- ppdet/modeling/necks/hrfpn.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ppdet/modeling/necks/hrfpn.py b/ppdet/modeling/necks/hrfpn.py index eb4768b8e..5c45c9974 100644 --- a/ppdet/modeling/necks/hrfpn.py +++ b/ppdet/modeling/necks/hrfpn.py @@ -37,7 +37,8 @@ class HRFPN(nn.Layer): out_channel=256, share_conv=False, extra_stage=1, - spatial_scales=[1. / 4, 1. / 8, 1. / 16, 1. / 32]): + spatial_scales=[1. / 4, 1. / 8, 1. / 16, 1. / 32], + use_bias=False): super(HRFPN, self).__init__() in_channel = sum(in_channels) self.in_channel = in_channel @@ -47,12 +48,14 @@ class HRFPN(nn.Layer): spatial_scales = spatial_scales + [spatial_scales[-1] / 2.] self.spatial_scales = spatial_scales self.num_out = len(self.spatial_scales) + self.use_bias = use_bias + bias_attr = False if use_bias is False else None self.reduction = nn.Conv2D( in_channels=in_channel, out_channels=out_channel, kernel_size=1, - bias_attr=False) + bias_attr=bias_attr) if share_conv: self.fpn_conv = nn.Conv2D( @@ -60,7 +63,7 @@ class HRFPN(nn.Layer): out_channels=out_channel, kernel_size=3, padding=1, - bias_attr=False) + bias_attr=bias_attr) else: self.fpn_conv = [] for i in range(self.num_out): @@ -72,7 +75,7 @@ class HRFPN(nn.Layer): out_channels=out_channel, kernel_size=3, padding=1, - bias_attr=False)) + bias_attr=bias_attr)) self.fpn_conv.append(conv) def forward(self, body_feats): -- GitLab