run the specific model

This commit is contained in:
2024-07-11 11:48:51 +02:00
parent f46486e21b
commit bb33ca9a68
3 changed files with 512 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ def obtain_accuracy(output, target, topk=(1,)):
res = []
for k in topk:
correct_k = correct[:k].view(-1).float().sum(0, keepdim=True)
# 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 / batch_size))
return res