Skip to content

Commit

Permalink
fixed acc
Browse files Browse the repository at this point in the history
  • Loading branch information
xvjiarui committed Apr 8, 2021
1 parent 56e9032 commit 59a6c85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmseg/models/losses/accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def accuracy(pred, target, topk=1, thresh=None):
correct = correct & (pred_value > thresh).t()
res = []
for k in topk:
correct_k = correct[:k].view(-1).float().sum(0, keepdim=True)
correct_k = correct[:k].reshape(-1).float().sum(0, keepdim=True)
res.append(correct_k.mul_(100.0 / target.numel()))
return res[0] if return_single else res

Expand Down

0 comments on commit 59a6c85

Please sign in to comment.