From 15fd9316f2fa76339631b3de6e8bc48fc336e75f Mon Sep 17 00:00:00 2001 From: Feng Ni Date: Thu, 9 Feb 2023 15:53:16 +0800 Subject: [PATCH] fix ppyoloe_head (#7717) --- ppdet/modeling/heads/ppyoloe_head.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ppdet/modeling/heads/ppyoloe_head.py b/ppdet/modeling/heads/ppyoloe_head.py index 201aa4812..5784f70f8 100644 --- a/ppdet/modeling/heads/ppyoloe_head.py +++ b/ppdet/modeling/heads/ppyoloe_head.py @@ -323,7 +323,11 @@ class PPYOLOEHead(nn.Layer): assigned_bboxes, assigned_scores, assigned_scores_sum): # select positive samples mask mask_positive = (assigned_labels != self.num_classes) - self.distill_pairs['mask_positive_select'] = mask_positive + + if self.for_distill: + # only used for LD main_kd distill + self.distill_pairs['mask_positive_select'] = mask_positive + num_pos = mask_positive.sum() # pos/neg loss if num_pos > 0: -- GitLab