From 66c3294cd2a0ce708eab0a57066af46b6da57c61 Mon Sep 17 00:00:00 2001 From: littletomatodonkey Date: Tue, 17 Aug 2021 17:09:38 +0800 Subject: [PATCH] fix cls type --- ppocr/losses/cls_loss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppocr/losses/cls_loss.py b/ppocr/losses/cls_loss.py index ecca5d2e17..abc5e5b72c 100755 --- a/ppocr/losses/cls_loss.py +++ b/ppocr/losses/cls_loss.py @@ -25,6 +25,6 @@ def __init__(self, **kwargs): self.loss_func = nn.CrossEntropyLoss(reduction='mean') def forward(self, predicts, batch): - label = batch[1] + label = batch[1].astype("int64") loss = self.loss_func(input=predicts, label=label) return {'loss': loss}