Skip to content

Commit

Permalink
Revert "loss detach (pytorch#731)" (pytorch#758)
Browse files Browse the repository at this point in the history
This reverts commit 391be73.
  • Loading branch information
soumith authored Apr 23, 2020
1 parent d431037 commit 69d2798
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imagenet/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def train(train_loader, model, criterion, optimizer, epoch, args):

# measure accuracy and record loss
acc1, acc5 = accuracy(output, target, topk=(1, 5))
losses.update(loss.detach().item(), images.size(0))
losses.update(loss.item(), images.size(0))
top1.update(acc1[0], images.size(0))
top5.update(acc5[0], images.size(0))

Expand Down

0 comments on commit 69d2798

Please sign in to comment.