Ejemplo n.º 1
0
def process_config(config_file, config_string):
    finalize_config(cfg, config_file, config_string)
Ejemplo n.º 2
0
def process_config(config_file, config_string):
    finalize_config(cfg, config_file, config_string)
Ejemplo n.º 3
0
        if not k.startswith("module."):
            raise TypeError("Not a multiple GPU state of dict")
        k1 = k[7:]
        new_sd[k1] = v
    return new_sd


if __name__ == "__main__":

    args = parse_args()

    config_file = args.config
    out_file = args.out_prefix + ".json"
    model_file = args.model_path

    finalize_config(cfg, config_file, None)

    batch_size = (cfg["data"]["batch_size"]
                  if args.batch_size is None else args.batch_size)
    if args.use_val:
        data_set_test = prepare_eval_data_set(**cfg["data"],
                                              **cfg["model"],
                                              verbose=True)
    else:
        data_set_test = prepare_test_data_set(**cfg["data"],
                                              **cfg["model"],
                                              verbose=True)
    data_reader_test = DataLoader(
        data_set_test,
        shuffle=False,
        batch_size=batch_size,