Skip to content

Commit

Permalink
[Fix] ignore_index in SARLoss (#869)
Browse files Browse the repository at this point in the history
* loss

* bug

* remove another fix
  • Loading branch information
Mountchicken authored Mar 24, 2022
1 parent 007871f commit 6512f0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmocr/models/textrecog/losses/ce_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class SARLoss(CELoss):
SARLoss assumes that the first input token is always `<SOS>`.
"""

def __init__(self, ignore_index=0, reduction='mean', **kwargs):
def __init__(self, ignore_index=-1, reduction='mean', **kwargs):
super().__init__(ignore_index, reduction)

def format(self, outputs, targets_dict):
Expand Down

0 comments on commit 6512f0a

Please sign in to comment.