diff --git a/ppdet/modeling/anchor_heads/ttf_head.py b/ppdet/modeling/anchor_heads/ttf_head.py index df50ca2d1637f18b9cbe75a0eaf1f2f365318a86..8640b3f48b70cad16eaa947bc459be987c26dc38 100644 --- a/ppdet/modeling/anchor_heads/ttf_head.py +++ b/ppdet/modeling/anchor_heads/ttf_head.py @@ -348,8 +348,7 @@ class TTFHead(object): return pred, target, weight def get_loss(self, pred_hm, pred_wh, target_hm, box_target, target_weight): - pred_hm = paddle.tensor.clamp( - fluid.layers.sigmoid(pred_hm), 1e-4, 1 - 1e-4) + pred_hm = paddle.clip(fluid.layers.sigmoid(pred_hm), 1e-4, 1 - 1e-4) hm_loss = self.ct_focal_loss(pred_hm, target_hm) * self.hm_weight shape = fluid.layers.shape(target_hm) shape.stop_gradient = True