mirror of
https://github.com/PaddlePaddle/PaddleClas.git
synced 2025-06-03 21:55:06 +08:00
fix_celoss
This commit is contained in:
parent
e360fd6b71
commit
eb44b8dfd7
@ -47,7 +47,6 @@ class CELoss(nn.Layer):
|
|||||||
loss = paddle.sum(x * label, axis=-1)
|
loss = paddle.sum(x * label, axis=-1)
|
||||||
else:
|
else:
|
||||||
if label.shape[-1] == x.shape[-1]:
|
if label.shape[-1] == x.shape[-1]:
|
||||||
label = F.softmax(label, axis=-1)
|
|
||||||
soft_label = True
|
soft_label = True
|
||||||
else:
|
else:
|
||||||
soft_label = False
|
soft_label = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user