Ejemplo n.º 1
0
def parse_args(argv):
    """Parse arguments @argv and return the flags needed for training."""
    parser = argparse.ArgumentParser(description=__doc__, allow_abbrev=False)

    group = parser.add_argument_group('General Options')
    opts.add_general_flags(group)

    group = parser.add_argument_group('Dataset Options')
    opts.add_dataset_flags(group)

    group = parser.add_argument_group('Model Options')
    opts.add_model_flags(group)

    group = parser.add_argument_group('Soft Label Options')
    opts.add_teacher_flags(group)

    group = parser.add_argument_group('Training Options')
    opts.add_training_flags(group)

    update_parser_defaults_from_yaml(parser)
    args = parser.parse_args(argv)

    # if args.teacher_model is not None and args.teacher_state_file is None:
    #     parser.error("You should set --teacher-state-file if "
    #                  "--teacher-model is set.")

    return args
Ejemplo n.º 2
0
def parse_args(argv):
    """Parse arguments @argv and return the flags needed for training."""
    parser = argparse.ArgumentParser(description=__doc__, allow_abbrev=False)

    group = parser.add_argument_group('General Options')
    opts.add_general_flags(group)

    group = parser.add_argument_group('Dataset Options')
    opts.add_dataset_flags(group)

    group = parser.add_argument_group('Model Options')
    opts.add_model_flags(group)

    group = parser.add_argument_group('Label Refinery Options')
    opts.add_label_refinery_flags(group)

    group = parser.add_argument_group('Training Options')
    opts.add_training_flags(group)

    args = parser.parse_args(argv)

    if args.label_refinery_model is not None and args.label_refinery_state_file is None:
        parser.error("You should set --label-refinery-state-file if "
                     "--label-refinery-model is set.")

    return args
Ejemplo n.º 3
0
def parse_args(argv):
    """Parse arguments @argv and return the flags needed for training."""
    parser = argparse.ArgumentParser(description=__doc__, allow_abbrev=False)

    group = parser.add_argument_group('General Options')
    opts.add_general_flags(group)

    group = parser.add_argument_group('Dataset Options')
    opts.add_dataset_flags(group)

    group = parser.add_argument_group('Model Options')
    opts.add_model_flags(group)

    group = parser.add_argument_group('Soft Label Options')
    opts.add_teacher_flags(group)

    group = parser.add_argument_group('Training Options')
    opts.add_training_flags(group)

    group = parser.add_argument_group('CutMix Training Options')
    opts.add_cutmix_training_flags(group)

    args = parser.parse_args(argv)

    return args
Ejemplo n.º 4
0
def parse_args(argv):
    """Parse arguments @argv and return the flags needed for training."""
    parser = argparse.ArgumentParser(description=__doc__, allow_abbrev=False)

    group = parser.add_argument_group('General Options')
    opts.add_general_flags(group)

    group = parser.add_argument_group('Dataset Options')
    opts.add_dataset_flags(group)

    group = parser.add_argument_group('Model Options')
    opts.add_model_flags(group)

    args = parser.parse_args(argv)

    if args.model_state_file is None:
        parser.error("You should set --model-state-file to reload a model "
                     "state.")

    return args