def main()

in train.py [0:0]


def main():
    # parse arguments
    parser = argparse.ArgumentParser()
    parser = add_args(parser)
    FLAGS = parser.parse_args()

    # convert to easy_dict; this is what is saved with model checkpoints and used in logic above
    keys = dir(FLAGS)
    flags_dict = EasyDict()
    for key in keys:
        if "__" not in key:
            flags_dict[key] = getattr(FLAGS, key)

    # postprocess arguments
    flags_dict.train = not flags_dict.no_train
    flags_dict.cuda = not flags_dict.no_cuda
    flags_dict.encoder_normalize_before = not flags_dict.no_encoder_normalize_before
    flags_dict.augment = not flags_dict.no_augment
    if not flags_dict.train:
        flags_dict.multisample = 1

    # Launch the job (optionally in a distributed manner)
    if flags_dict.gpus > 1:
        mp.spawn(main_single, nprocs=flags_dict.gpus, args=(flags_dict,))
    else:
        main_single(0, flags_dict)