From d618e6f8d70413de49e03c33a81635881c5f9b91 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Wed, 28 Sep 2022 16:35:22 +0100 Subject: [PATCH] =?UTF-8?q?pretrain-predict:=20params.json=20=E2=86=92=20m?= =?UTF-8?q?etadata.jsonl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aimodel/src/subcommands/pretrain_predict.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/aimodel/src/subcommands/pretrain_predict.py b/aimodel/src/subcommands/pretrain_predict.py index bf43772..57f6335 100644 --- a/aimodel/src/subcommands/pretrain_predict.py +++ b/aimodel/src/subcommands/pretrain_predict.py @@ -79,16 +79,16 @@ def run(args): write_mode = "wb" handle = sys.stdout - filepath_params = None + filepath_metadata = None if filepath_output != "-": handle = handle_open( filepath_output if args.records_per_file <= 0 else filepath_output.replace("+d", str(0)), write_mode ) - filepath_params = os.path.join(os.path.dirname(filepath_output), "params.json") + filepath_metadata = os.path.join(os.path.dirname(filepath_output), "metadata.json") logger.info(f"filepath_output: {filepath_output}") - logger.info(f"filepath_params: {filepath_params}") + logger.info(f"filepath_params: {filepath_metadata}") i = 0 i_file = i @@ -104,8 +104,8 @@ def run(args): if output_mode == MODE_JSONL: handle.write(json.dumps(step_rainfall.numpy().tolist(), separators=(',', ':'))+"\n") # Ref https://stackoverflow.com/a/64710892/1460422 elif output_mode == MODE_TFRECORD: - if i == 0 and filepath_params is not None: - writefile(filepath_params, json.dumps({ + if i == 0 and filepath_metadata is not None: + writefile(filepath_metadata, json.dumps({ "rainfallradar": step_rainfall.shape.as_list(), "waterdepth": step_water.shape.as_list() }))