Skip to content

Commit 391be73

Browse files
loss detach (#731)
loss detach
1 parent 80fcb66 commit 391be73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

imagenet/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def train(train_loader, model, criterion, optimizer, epoch, args):
289289

290290
# measure accuracy and record loss
291291
acc1, acc5 = accuracy(output, target, topk=(1, 5))
292-
losses.update(loss.item(), images.size(0))
292+
losses.update(loss.detach().item(), images.size(0))
293293
top1.update(acc1[0], images.size(0))
294294
top5.update(acc5[0], images.size(0))
295295

0 commit comments

Comments
 (0)