From c0cb9b02be7ff7bea26b17a17a5a359c4a22090a Mon Sep 17 00:00:00 2001 From: shangliang Xu Date: Wed, 20 Apr 2022 18:59:39 +0800 Subject: [PATCH] [PPYOLOE] fix loss bug in negative batch (#5774) --- 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