未验证 提交 0077c107 编写于 作者: N niefeng 提交者: GitHub

fix ppyoloe+ distill mask_positive (#8340)

上级 83e538fe
...@@ -332,12 +332,11 @@ class PPYOLOEDistillModel(DistillModel): ...@@ -332,12 +332,11 @@ class PPYOLOEDistillModel(DistillModel):
with paddle.no_grad(): with paddle.no_grad():
teacher_loss = self.teacher_model(inputs) teacher_loss = self.teacher_model(inputs)
if hasattr(self.teacher_model.yolo_head, "assigned_labels"): 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.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, self.teacher_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
delattr(self.teacher_model.yolo_head, "assigned_labels") delattr(self.teacher_model.yolo_head, "assigned_labels")
delattr(self.teacher_model.yolo_head, "assigned_bboxes") delattr(self.teacher_model.yolo_head, "assigned_bboxes")
delattr(self.teacher_model.yolo_head, "assigned_scores") delattr(self.teacher_model.yolo_head, "assigned_scores")
delattr(self.teacher_model.yolo_head, "mask_positive")
student_loss = self.student_model(inputs) student_loss = self.student_model(inputs)
logits_loss, feat_loss = self.distill_loss(self.teacher_model, logits_loss, feat_loss = self.distill_loss(self.teacher_model,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册