Skip to content

Commit

Permalink
fix broken args\n\nFor multiple long options python takes the first a…
Browse files Browse the repository at this point in the history
…s attribute name by default. The latest commit swapped the order of options that causes the script an error. Added dest option to explicitly specify the valid attribute name (pytorch#454)
  • Loading branch information
ntomita authored and soumith committed Nov 26, 2018
1 parent 537f697 commit df70aa7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions imagenet/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@
'batch size of all GPUs on the current node when '
'using Data Parallel or Distributed Data Parallel')
parser.add_argument('--lr', '--learning-rate', default=0.1, type=float,
metavar='LR', help='initial learning rate')
metavar='LR', help='initial learning rate', dest='lr')
parser.add_argument('--momentum', default=0.9, type=float, metavar='M',
help='momentum')
parser.add_argument('--wd', '--weight-decay', default=1e-4, type=float,
metavar='W', help='weight decay (default: 1e-4)')
metavar='W', help='weight decay (default: 1e-4)',
dest='weight_decay')
parser.add_argument('-p', '--print-freq', default=10, type=int,
metavar='N', help='print frequency (default: 10)')
parser.add_argument('--resume', default='', type=str, metavar='PATH',
Expand Down

0 comments on commit df70aa7

Please sign in to comment.