我有一个关于下例中使用的batch_size
参数的问题。你知道吗
https://github.com/pytorch/examples/blob/master/imagenet/main.py#L150
parser.add_argument('-b', '--batch-size', default=256, type=int,
metavar='N',
# dest='batch_size' why this is not needed?
help='mini-batch size (default: 256), this is the total '
'batch size of all GPUs on the current node when '
'using Data Parallel or Distributed Data Parallel')
# missing code
args.batch_size = int(args.batch_size / ngpus_per_node)
我的问题是没有dest
参数,如何从命令行解析和保存batch_size
?你知道吗
从https://docs.python.org/2/library/argparse.html#dest:
在这种情况下,
long-option
是batch-size
,因此默认情况下dest
设置为batch_size
相关问题 更多 >
编程相关推荐