modelzoo.common.run_utils.cli_parser.get_parser#

modelzoo.common.run_utils.cli_parser.get_parser(run_dir: Optional[str] = None, first_parse: bool = True, extra_args_parser_fn: Optional[Callable[[], List[argparse.ArgumentParser]]] = None, device_type: Optional[modelzoo.common.run_utils.utils.DeviceType] = None, parser_epilog: Optional[str] = None, csx_parser_epilog: Optional[str] = None, modes: List[str] = ['train', 'eval', 'train_and_eval', 'eval_all']) argparse.ArgumentParser[source]#

Returns an ArgumentParser for parsing commandline options.

Parameters
  • run_dir – String to be used to determine model directory.

  • first_parse – Boolean indicating whether this is the first time processing the arguments. If True, the parser is being used to collect commandline inputs. If False, it is only being used for verification on existing params.

  • extra_args_parser_fn – Parent parser passed in by models with unique specific arguments.

  • device_type – The device type for which to fetch to add the args to the new parser. If None, all device type (CPU, GPU, CSX) args are added.

  • parser_epilog – Optional helpful text to add to the end of the main parser’s help message

  • csx_parser_epilog – Optional helpful text to add to the end of the CSX subparser’s help message

  • modes – Optional list of valid modes to be passed under the –mode argument of the parser. We default to choices [“train”, “eval”, “train_and_eval”, “eval_all”]. If an empty list if provided, then –mode isn’t added as a parser arg.

Returns

A parser instance.