Skip to content

Commit

Permalink
Update train.py
Browse files Browse the repository at this point in the history
  • Loading branch information
fffffgggg54 committed Aug 7, 2024
1 parent d77a8ad commit 969955e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ def _forward():
with amp_autocast():
output = model(input)
loss = loss_fn(output, target)
acc1 = utils.accuracy(output, target.topk(1, 1), topk=(1,))[0]
acc1 = utils.accuracy(output, target.topk(1, 1)[1], topk=(1,))[0]

if accum_steps > 1:
loss /= accum_steps
Expand Down

0 comments on commit 969955e

Please sign in to comment.