From f08c2ca7aff0eec9bb590d861c37a6700b7ce2ea Mon Sep 17 00:00:00 2001 From: Guanghua Yu <742925032@qq.com> Date: Fri, 11 Mar 2022 18:11:44 +0800 Subject: [PATCH] fix picoheadv2 use_align_head (#5352) --- ppdet/modeling/heads/pico_head.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ppdet/modeling/heads/pico_head.py b/ppdet/modeling/heads/pico_head.py index dbdc1cfc6..8a5e04412 100644 --- a/ppdet/modeling/heads/pico_head.py +++ b/ppdet/modeling/heads/pico_head.py @@ -466,9 +466,7 @@ class PicoHeadV2(GFLHead): ), "The size of fpn_feats is not equal to size of fpn_stride" cls_score_list, reg_list, box_list = [], [], [] - for i, fpn_feat, stride, align_cls in zip( - range(len(self.fpn_stride)), fpn_feats, self.fpn_stride, - self.cls_align): + for i, (fpn_feat, stride) in enumerate(zip(fpn_feats, self.fpn_stride)): b, _, h, w = get_static_shape(fpn_feat) # task decomposition conv_cls_feat, se_feat = self.conv_feat(fpn_feat, i) @@ -477,7 +475,7 @@ class PicoHeadV2(GFLHead): # cls prediction and alignment if self.use_align_head: - cls_prob = F.sigmoid(align_cls(conv_cls_feat)) + cls_prob = F.sigmoid(self.cls_align[i](conv_cls_feat)) cls_score = (F.sigmoid(cls_logit) * cls_prob + eps).sqrt() else: cls_score = F.sigmoid(cls_logit) -- GitLab