From 538a4b504065f104f54ed59a6fd12cf0f7b03bd5 Mon Sep 17 00:00:00 2001 From: wangguanzhong Date: Mon, 15 Mar 2021 20:40:04 +0800 Subject: [PATCH] fix fcos (#2354) --- ppdet/modeling/losses/fcos_loss.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ppdet/modeling/losses/fcos_loss.py b/ppdet/modeling/losses/fcos_loss.py index e9b94378f..7275874c6 100644 --- a/ppdet/modeling/losses/fcos_loss.py +++ b/ppdet/modeling/losses/fcos_loss.py @@ -197,10 +197,9 @@ class FCOSLoss(object): reg_loss = fluid.layers.elementwise_mul( reg_loss, mask_positive_float, axis=0) / normalize_sum ctn_loss = fluid.layers.sigmoid_cross_entropy_with_logits( - x=centerness_flatten, - label=tag_center_flatten) * mask_positive_float / num_positive_fp32 + x=centerness_flatten, label=tag_center_flatten) ctn_loss = fluid.layers.elementwise_mul( - ctn_loss, mask_positive_float, axis=0) / normalize_sum + ctn_loss, mask_positive_float, axis=0) / num_positive_fp32 loss_all = { "loss_centerness": fluid.layers.reduce_sum(ctn_loss), "loss_cls": fluid.layers.reduce_sum(cls_loss), -- GitLab