From 9811a09e939d64ea76d05aba169d61937bfe0c32 Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Tue, 6 Jul 2021 08:16:01 +0000 Subject: [PATCH] fix combined loss --- ppocr/losses/combined_loss.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ppocr/losses/combined_loss.py b/ppocr/losses/combined_loss.py index 639265ed..eb1ad9bf 100644 --- a/ppocr/losses/combined_loss.py +++ b/ppocr/losses/combined_loss.py @@ -53,8 +53,9 @@ class CombinedLoss(nn.Layer): for key in loss: if key == "loss": loss_all += loss[key] * weight - # else: - # loss[f"{key}_{idx}"] = loss[key] + else: + loss["{}_{}".format(key, idx)] = loss[key] + # loss[f"{key}_{idx}"] = loss[key] loss_dict.update(loss) loss_dict["loss"] = loss_all return loss_dict -- GitLab