return all args
()
| 151 | |
| 152 | |
| 153 | def parse_args(): |
| 154 | """return all args |
| 155 | """ |
| 156 | parser = argparse.ArgumentParser(description=__doc__) |
| 157 | add_arg = functools.partial(add_arguments, argparser=parser) |
| 158 | # yapf: disable |
| 159 | # ENV |
| 160 | add_arg('use_gpu', bool, True, "Whether use GPU.") |
| 161 | add_arg('model_arch', str, 'ResNet101_vd', "The model arch to train.") |
| 162 | |
| 163 | add_arg('pretrain', str, 'pretrained/ResNet101_vd_pretrained', "The pretrain model path.") |
| 164 | add_arg('weights', str, 'model_iter129999', "The weights path.") |
| 165 | |
| 166 | add_arg('data_dir', str, 'dataset/aicity20_all', "The data root path.") |
| 167 | add_arg('model_save_dir', str, 'output', "The path to save model.") |
| 168 | |
| 169 | #SOLVER |
| 170 | add_arg('batch_size', int, 64, "Mini-batch size per device.") |
| 171 | add_arg('test_batch_size', int, 32, "Mini-batch size per device.") |
| 172 | add_arg('num_instances', int, 4, "Mini-batch size per device.") |
| 173 | add_arg('learning_rate', float, 0.01, "Learning rate.") |
| 174 | add_arg('warm_up_iter', float, 8000, "Learning rate.") |
| 175 | add_arg('start_iter', int, 0, "Start iteration.") |
| 176 | add_arg('max_iter', int, 230000, "Iter number.") |
| 177 | add_arg('snapshot_iter', int, 3000, "Save model every snapshot stride.") |
| 178 | add_arg('lr_steps', nargs='+', type=int, default=[100000, 160000, 200000], help="The mean of input image data") |
| 179 | |
| 180 | |
| 181 | add_arg('margin', float, 0.3, "intra class margin for TripletLoss.") |
| 182 | |
| 183 | |
| 184 | # TRAIN TEST INFER |
| 185 | add_arg('big_height', int, 384, "Image big_height.") |
| 186 | add_arg('big_width', int, 384, "Image big_width.") |
| 187 | add_arg('target_height', int, 384, "Image target_height.") |
| 188 | add_arg('target_width', int, 384, "Image target_width.") |
| 189 | |
| 190 | add_arg('padding_size', int, 10, "Image padding size.") |
| 191 | add_arg('re_prob', float, 0.5, "Image random erase probility.") |
| 192 | |
| 193 | add_arg('use_flip', bool, False, "Whether use flip.") |
| 194 | add_arg('flip_test', bool, False, "Whether use flip in test.") |
| 195 | add_arg('use_autoaug', bool, False, "Whether use autoaug.") |
| 196 | add_arg('use_crop', bool, False, "Whether use crop.") |
| 197 | |
| 198 | |
| 199 | add_arg('use_multi_branch', bool, False, "whether using multi_branch_arch") |
| 200 | add_arg('num_features', int, 512, "feature dims.") |
| 201 | add_arg('syncbn', bool, True, "Whether to use synchronized batch normalization.") |
| 202 | |
| 203 | |
| 204 | args = parser.parse_args() |
| 205 | merge_cfg_from_args(args) |
| 206 | return cfg |
| 207 | |
| 208 |
no test coverage detected