MCPcopy Create free account
hub / github.com/LeapLabTHU/DAT / parse_option

Function parse_option

main.py:39–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37
38
39def parse_option():
40 parser = argparse.ArgumentParser()
41 parser.add_argument('--cfg', type=str, required=True, metavar="FILE", help='path to config file', )
42 parser.add_argument(
43 "--opts",
44 help="Modify config options by adding 'KEY VALUE' pairs. ",
45 default=None,
46 nargs='+',
47 )
48 # easy config modification
49 parser.add_argument('--batch-size', type=int, help="batch size for single GPU")
50 parser.add_argument('--data-path', type=str, help='path to dataset')
51 parser.add_argument('--resume', help='resume from checkpoint')
52 parser.add_argument('--amp', action='store_true', default=False)
53 parser.add_argument('--output', default='output', type=str, metavar='PATH',
54 help='root of output folder, the full path is <output>/<model_name>/<tag> (default: output)')
55 parser.add_argument('--tag', help='tag of experiment')
56 parser.add_argument('--eval', action='store_true', help='Perform evaluation only')
57 parser.add_argument('--throughput', action='store_true', help='Test throughput only')
58 parser.add_argument('--print-freq', type=int, help='Printing frequency.', default=100)
59
60 args, unparsed = parser.parse_known_args()
61
62 config = get_config(args)
63
64 return args, config
65
66
67def main():

Callers 1

mainFunction · 0.70

Calls 1

get_configFunction · 0.90

Tested by

no test coverage detected