Skip to content

Commit

Permalink
Update imagenet_eval.py to torch 1.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadene committed Apr 3, 2019
1 parent 3fc49a5 commit 021d978
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/imagenet_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ def validate(val_loader, model, criterion):

# measure accuracy and record loss
prec1, prec5 = accuracy(output.data, target.data, topk=(1, 5))
losses.update(loss.data[0], input.size(0))
top1.update(prec1[0], input.size(0))
top5.update(prec5[0], input.size(0))
losses.update(loss.data.item(), input.size(0))
top1.update(prec1.item(), input.size(0))
top5.update(prec5.item(), input.size(0))

# measure elapsed time
batch_time.update(time.time() - end)
Expand Down

0 comments on commit 021d978

Please sign in to comment.