defparse_args():
parser = argparse.ArgumentParser(description='Train SSD networks.')##--SSD的主干网络
parser.add_argument('--network',type=str, default='vgg16_atrous',help="Base network name which serves as feature extraction base.")##--SSD网络输入图片的尺寸
parser.add_argument('--data-shape',type=int, default=300,help="Input data shape, use 300, 512.")##--批量数据大小
parser.add_argument('--batch-size',type=int, default=32,help='Training mini-batch size')##--训练数据集类型
parser.add_argument('--dataset',type=str, default='voc',help='Training dataset. Now support voc.')##--数据集存放的路径
parser.add_argument('--dataset-root',type=str, default='~/.mxnet/datasets/',help='Path of the directory where the dataset is located.')##--多进程加速加载数据
parser.add_argument('--num-workers','-j', dest='num_workers',type=int,
default=4,help='Number of data workers, you can use larger ''number to accelerate data loading, if you CPU and GPUs are powerful.')##--使用多gpu
parser.add_argument('--gpus',type=str, default='0',help='Training with GPUs, you can specify 1,3 for example.')##--训练迭代数
parser.add_argument('--epochs',type=int, default=240,help='Training epochs.')##--继续上次中断之后开始训练
parser.add_argument('--resume',type=str, default='',help='Resume from previously saved parameters if not None. ''For example, you can resume from ./ssd_xxx_0123.params')##--配合上面的一起用,指定从第几次迭代开始。
parser.add_argument('--start-epoch',type=int, default=0,help='Starting epoch for resuming, default is 0 for new training.''You can specify it to 100 for example to start from 100 epoch.')##--学习率
parser.add_argument('--lr',type=float, default=0.001,help='Learning rate, default is 0.001')##--学习率的衰减率
parser.add_argument('--lr-decay',type=float, default=0.1,help='decay rate of learning rate. default is 0.1.')##--第几次迭代开始衰减
parser.add_argument('--lr-decay-epoch',type=str, default='160,200',help='epochs at which learning rate decays. default is 160,200.')##--SGD动量法参数
parser.add_argument('--momentum',type=float, default=0.9,help='SGD momentum, default is 0.9')##--权重衰减系数(正则化)
parser.add_argument('--wd',type=float, default=0.0005,help='Weight decay, default is 5e-4')##--指定多少个batch打印一次
parser.add_argument('--log-interval',type=int, default=100,help='Logging mini-batch interval. Default is 100.')##--训练过程中或者训练完存储参数的时候指定的前缀名
parser.add_argument('--save-prefix',type=str, default='',help='Saving parameter prefix')##--指定多少个epoch存一次参数,防止训练中断。
parser.add_argument('--save-interval',type=int, default=10,help='Saving parameters epoch interval, best model will always be saved.')##--指定多少个epoch进行一次验证
parser.add_argument('--val-interval',type=int, default=1,help='Epoch interval for validation, increase the number will reduce the ''training time if validation is slow.')##--这是什么鬼
parser.add_argument('--seed',type=int, default=233,help='Random seed to be fixed.')##--这又是什么鬼
parser.add_argument('--syncbn', action='store_true',help='Use synchronize BN across devices.')##--加速训练的DALI模块
parser.add_argument('--dali', action='store_true',help='Use DALI for data loading and data preprocessing in training. ''Currently supports only COCO.')##--混合进度训练可用于节省显存和加快速度
parser.add_argument('--amp', action='store_true',help='Use MXNet AMP for mixed precision training.')##--使用分布式训练框架
parser.add_argument('--horovod', action='store_true',help='Use MXNet Horovod for distributed training. Must be run with OpenMPI. ''--gpus is ignored when using --horovod.')
args = parser.parse_args()if args.horovod:assert hvd,"You are trying to use horovod support but it's not installed"return args