def test_train_options_model_specified(): print("-----------------------------------------------------") print("Test: test_train_options_model_specified") parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter) train_options = TrainOptions() parser = train_options.initialize(parser) opts, _ = parser.parse_known_args() model_name = opts.model model_option_setter = models.get_option_setter(model_name) parser = model_option_setter(parser, is_train=train_options.isTrain) opts, _ = parser.parse_known_args() # parse again with new defaults print_basic_opts(opts) print_train_opts(opts) model = find_model_using_name(model_name) print(model) print("------------------- Dataset Config -----------------") print(".. --input_means %s" % opts.input_means) print(".. --input_size %s" % opts.input_size) print(".. --input_range %s" % opts.input_range) print(".. --input_channels %s" % opts.input_nc) print(".. --input_std %s" % opts.input_std) print("-----------------------------------------------------\n\n")
def test_train_options_dataset_specified(): print("-----------------------------------------------------") print("Test: test_train_options_dataset_specified") parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter) train_options = TrainOptions() parser = train_options.initialize(parser) opts, _ = parser.parse_known_args() dataset_name = opts.dataset_mode dataset_option_setter = get_option_setter(dataset_name) parser = dataset_option_setter(parser, is_train=train_options.isTrain) opts, _ = parser.parse_known_args() # parse again with new defaults print_basic_opts(opts) print_train_opts(opts) dataset = find_dataset_using_name(dataset_name) print(dataset) print("------------------- Dataset Config -----------------") print(".. --dataset_mode %s" % opts.dataset_mode) print(".. --img_name_tmpl %s" % opts.img_name_tmpl) print(".. --split_dir %s" % opts.split_dir) print("-----------------------------------------------------\n\n")