MCPcopy Create free account
hub / github.com/AutonomousVehicleLaboratory/SemVecNet / parse_args

Function parse_args

SemVecNet/mmdetection3d/tools/train.py:25–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23
24
25def parse_args():
26 parser = argparse.ArgumentParser(description='Train a detector')
27 parser.add_argument('config', help='train config file path')
28 parser.add_argument('--work-dir', help='the dir to save logs and models')
29 parser.add_argument(
30 '--resume-from', help='the checkpoint file to resume from')
31 parser.add_argument(
32 '--no-validate',
33 action='store_true',
34 help='whether not to evaluate the checkpoint during training')
35 group_gpus = parser.add_mutually_exclusive_group()
36 group_gpus.add_argument(
37 '--gpus',
38 type=int,
39 help='number of gpus to use '
40 '(only applicable to non-distributed training)')
41 group_gpus.add_argument(
42 '--gpu-ids',
43 type=int,
44 nargs='+',
45 help='ids of gpus to use '
46 '(only applicable to non-distributed training)')
47 parser.add_argument('--seed', type=int, default=0, help='random seed')
48 parser.add_argument(
49 '--deterministic',
50 action='store_true',
51 help='whether to set deterministic options for CUDNN backend.')
52 parser.add_argument(
53 '--options',
54 nargs='+',
55 action=DictAction,
56 help='override some settings in the used config, the key-value pair '
57 'in xxx=yyy format will be merged into config file (deprecate), '
58 'change to --cfg-options instead.')
59 parser.add_argument(
60 '--cfg-options',
61 nargs='+',
62 action=DictAction,
63 help='override some settings in the used config, the key-value pair '
64 'in xxx=yyy format will be merged into config file. If the value to '
65 'be overwritten is a list, it should be like key="[a,b]" or key=a,b '
66 'It also allows nested list/tuple values, e.g. key="[(a,b),(c,d)]" '
67 'Note that the quotation marks are necessary and that no white space '
68 'is allowed.')
69 parser.add_argument(
70 '--launcher',
71 choices=['none', 'pytorch', 'slurm', 'mpi'],
72 default='none',
73 help='job launcher')
74 parser.add_argument('--local_rank', type=int, default=0)
75 parser.add_argument(
76 '--autoscale-lr',
77 action='store_true',
78 help='automatically scale lr with the number of gpus')
79 args = parser.parse_args()
80 if 'LOCAL_RANK' not in os.environ:
81 os.environ['LOCAL_RANK'] = str(args.local_rank)
82

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected