diff --git a/ppocr/losses/ace_loss.py b/ppocr/losses/ace_loss.py index 9c868520e5bd7b398c7f248c416b70427baee0a6..bf15f8e3a7b355bd9e8b69435a5dae01fc75a892 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}