From 1ac84b075a6d8e4c2f6cccd63c6bf6c0c8478e16 Mon Sep 17 00:00:00 2001 From: Bin Lu Date: Wed, 13 Oct 2021 15:13:19 +0800 Subject: [PATCH] Update ace_loss.py --- ppocr/losses/ace_loss.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ppocr/losses/ace_loss.py b/ppocr/losses/ace_loss.py index 9c868520..bf15f8e3 100644 --- a/ppocr/losses/ace_loss.py +++ b/ppocr/losses/ace_loss.py @@ -32,6 +32,7 @@ class ACELoss(nn.Layer): def __call__(self, predicts, batch): if isinstance(predicts, (list, tuple)): predicts = predicts[-1] + B, N = predicts.shape[:2] div = paddle.to_tensor([N]).astype('float32') @@ -42,9 +43,7 @@ class ACELoss(nn.Layer): length = batch[2].astype("float32") batch = batch[3].astype("float32") batch[:, 0] = paddle.subtract(div, length) - batch = paddle.divide(batch, div) loss = self.loss_func(aggregation_preds, batch) - return {"loss_ace": loss} -- GitLab