From d63faf0365b5c7e4f16a991ed38081add90b389c Mon Sep 17 00:00:00 2001 From: shangliang Xu Date: Thu, 21 Apr 2022 13:31:05 +0800 Subject: [PATCH] [PPYOLOE] fix loss bug in negative batch (#5775) --- ppdet/modeling/heads/ppyoloe_head.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppdet/modeling/heads/ppyoloe_head.py b/ppdet/modeling/heads/ppyoloe_head.py index 01d7e9174..70d93f2e1 100644 --- a/ppdet/modeling/heads/ppyoloe_head.py +++ b/ppdet/modeling/heads/ppyoloe_head.py @@ -293,7 +293,7 @@ class PPYOLOEHead(nn.Layer): else: loss_l1 = paddle.zeros([1]) loss_iou = paddle.zeros([1]) - loss_dfl = paddle.zeros([1]) + loss_dfl = pred_dist.sum() * 0. return loss_l1, loss_iou, loss_dfl def get_loss(self, head_outs, gt_meta): -- GitLab