Skip to content

Commit

Permalink
fix: there may not be weight ratio in multilabel dataset label (#3227)
Browse files Browse the repository at this point in the history
  • Loading branch information
TingquanGao authored Aug 23, 2024
1 parent 1b99736 commit d1634d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ppcls/loss/multilabelloss.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _labelsmoothing(self, target, class_num):
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)
Expand Down

0 comments on commit d1634d4

Please sign in to comment.