From 0077c107a79ac6da9b5201ad00234108fd750bbf Mon Sep 17 00:00:00 2001 From: niefeng Date: Tue, 13 Jun 2023 10:44:24 +0800 Subject: [PATCH] fix ppyoloe+ distill mask_positive (#8340) --- ppdet/slim/distill_model.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ppdet/slim/distill_model.py b/ppdet/slim/distill_model.py index 96e136638..4fa3ccc83 100644 --- a/ppdet/slim/distill_model.py +++ b/ppdet/slim/distill_model.py @@ -332,12 +332,11 @@ class PPYOLOEDistillModel(DistillModel): with paddle.no_grad(): teacher_loss = self.teacher_model(inputs) if hasattr(self.teacher_model.yolo_head, "assigned_labels"): - self.student_model.yolo_head.assigned_labels, self.student_model.yolo_head.assigned_bboxes, self.student_model.yolo_head.assigned_scores, self.student_model.yolo_head.mask_positive = \ - self.teacher_model.yolo_head.assigned_labels, self.teacher_model.yolo_head.assigned_bboxes, self.teacher_model.yolo_head.assigned_scores, self.teacher_model.yolo_head.mask_positive + self.student_model.yolo_head.assigned_labels, self.student_model.yolo_head.assigned_bboxes, self.student_model.yolo_head.assigned_scores = \ + self.teacher_model.yolo_head.assigned_labels, self.teacher_model.yolo_head.assigned_bboxes, self.teacher_model.yolo_head.assigned_scores delattr(self.teacher_model.yolo_head, "assigned_labels") delattr(self.teacher_model.yolo_head, "assigned_bboxes") delattr(self.teacher_model.yolo_head, "assigned_scores") - delattr(self.teacher_model.yolo_head, "mask_positive") student_loss = self.student_model(inputs) logits_loss, feat_loss = self.distill_loss(self.teacher_model, -- GitLab