fix cls type

This commit is contained in:
littletomatodonkey 2021-08-17 17:09:38 +08:00
parent a81b88a01a
commit 66c3294cd2
1 changed files with 1 additions and 1 deletions

View File

@ -25,6 +25,6 @@ class ClsLoss(nn.Layer):
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}