Skip to content

main

run_main

A function which invokes the various argument parsers and then runs the requested subroutine.

Source code in fastestimator/fastestimator/cli/main.py
def run_main(argv) -> None:
    """A function which invokes the various argument parsers and then runs the requested subroutine.
    """
    parser = argparse.ArgumentParser(allow_abbrev=False)
    subparsers = parser.add_subparsers()
    # In python 3.7 the following 2 lines could be put into the .add_subparsers() call
    subparsers.required = True
    subparsers.dest = 'mode'
    configure_train_parser(subparsers)
    configure_test_parser(subparsers)
    configure_run_parser(subparsers)
    configure_log_parser(subparsers)
    configure_plot_parser(subparsers)
    configure_history_parser(subparsers)
    args, unknown = parser.parse_known_args(argv)
    args.func(vars(args), unknown)