Skip to content

Commit 832141b

Browse files
Junoniasoumith
authored andcommitted
Update main.py (pytorch#65)
1 parent b59153a commit 832141b

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
@@ -263,7 +263,7 @@ def update(self, val, n=1):
263263
def adjust_learning_rate(optimizer, epoch):
264264
"""Sets the learning rate to the initial LR decayed by 10 every 30 epochs"""
265265
lr = args.lr * (0.1 ** (epoch // 30))
266-
for param_group in optimizer.state_dict()['param_groups']:
266+
for param_group in optimizer.param_groups:
267267
param_group['lr'] = lr
268268

269269

0 commit comments

Comments
 (0)