From 95d07675d4776c4002e49981c6d90b920b6754c7 Mon Sep 17 00:00:00 2001 From: littletomatodonkey Date: Wed, 9 Jun 2021 08:06:28 +0000 Subject: [PATCH] fix kldiv input --- ppocr/losses/basic_loss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppocr/losses/basic_loss.py b/ppocr/losses/basic_loss.py index 4f9a9133..fa3ceda1 100644 --- a/ppocr/losses/basic_loss.py +++ b/ppocr/losses/basic_loss.py @@ -79,7 +79,7 @@ class DMLLoss(nn.Layer): log_out2 = paddle.log(out2) loss = (F.kl_div( log_out1, out2, reduction='batchmean') + F.kl_div( - log_out2, log_out1, reduction='batchmean')) / 2.0 + log_out2, out1, reduction='batchmean')) / 2.0 return loss -- GitLab