mirror of
https://github.com/PaddlePaddle/PaddleClas.git
synced 2025-06-03 21:55:06 +08:00
fix: there may not be weight ratio in multilabel dataset label (#3226)
This commit is contained in:
parent
666ca9bbd1
commit
bc9401f861
@ -39,7 +39,7 @@ class MultiLabelLoss(nn.Layer):
|
||||
def _binary_crossentropy(self, input, target, class_num):
|
||||
if self.weight_ratio:
|
||||
target, label_ratio = target[:, 0, :], target[:, 1, :]
|
||||
else:
|
||||
elif target.ndim == 3:
|
||||
target = target[:, 0, :]
|
||||
if self.epsilon is not None:
|
||||
target = self._labelsmoothing(target, class_num)
|
||||
|
Loading…
x
Reference in New Issue
Block a user