mirror of
https://github.com/huggingface/pytorch-image-models.git
synced 2025-06-03 15:01:08 +08:00
Fix a bug with accuracy retrieving from RealLabels
This commit is contained in:
parent
6f43aeb252
commit
de15b43865
@ -37,6 +37,6 @@ class RealLabelsImagenet:
|
||||
|
||||
def get_accuracy(self, k=None):
|
||||
if k is None:
|
||||
return {k: float(np.mean(self.is_correct[k] for k in self.topk))}
|
||||
return {k: float(np.mean(self.is_correct[k])) * 100 for k in self.topk}
|
||||
else:
|
||||
return float(np.mean(self.is_correct[k])) * 100
|
||||
|
Loading…
x
Reference in New Issue
Block a user