MCPcopy Create free account
hub / github.com/InternRobotics/EmbodiedScan / parse_args

Function parse_args

tools/train.py:13–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12
13def parse_args():
14 parser = argparse.ArgumentParser(description='Train a 3D detector')
15 parser.add_argument('config', help='train config file path')
16 parser.add_argument('--work-dir', help='the dir to save logs and models')
17 parser.add_argument('--task-name', help='task names')
18 parser.add_argument('--amp',
19 action='store_true',
20 default=False,
21 help='enable automatic-mixed-precision training')
22 parser.add_argument('--auto-scale-lr',
23 action='store_true',
24 help='enable automatically scaling LR.')
25 parser.add_argument(
26 '--resume',
27 nargs='?',
28 type=str,
29 const='auto',
30 help='If specify checkpoint path, resume from it, while if not '
31 'specify, try to auto resume from the latest checkpoint '
32 'in the work directory.')
33 parser.add_argument('--ceph',
34 action='store_true',
35 help='Use ceph as data storage backend')
36 parser.add_argument(
37 '--cfg-options',
38 nargs='+',
39 action=DictAction,
40 help='override some settings in the used config, the key-value pair '
41 'in xxx=yyy format will be merged into config file. If the value to '
42 'be overwritten is a list, it should be like key="[a,b]" or key=a,b '
43 'It also allows nested list/tuple values, e.g. key="[(a,b),(c,d)]" '
44 'Note that the quotation marks are necessary and that no white space '
45 'is allowed.')
46 parser.add_argument('--launcher',
47 choices=['none', 'pytorch', 'slurm', 'mpi'],
48 default='none',
49 help='job launcher')
50 # When using PyTorch version >= 2.0.0, the `torch.distributed.launch`
51 # will pass the `--local-rank` parameter to `tools/train.py` instead
52 # of `--local_rank`.
53 parser.add_argument('--local_rank', '--local-rank', type=int, default=0)
54 args = parser.parse_args()
55 if 'LOCAL_RANK' not in os.environ:
56 os.environ['LOCAL_RANK'] = str(args.local_rank)
57 return args
58
59
60def main():

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected