From e6cd0aa1b9074cb332711c4063217e7dedef50c8 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 10 Mar 2023 17:14:06 +0000 Subject: [PATCH] dlr: fix crash --- aimodel/src/deeplabv3_plus_test_rainfall.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aimodel/src/deeplabv3_plus_test_rainfall.py b/aimodel/src/deeplabv3_plus_test_rainfall.py index 114f857..cd35428 100755 --- a/aimodel/src/deeplabv3_plus_test_rainfall.py +++ b/aimodel/src/deeplabv3_plus_test_rainfall.py @@ -314,7 +314,8 @@ def save_samples(filepath, save_list): def plot_predictions(filepath, input_items, colormap, model): filepath_jsonl = filepath.replace("_$$", "").replace(".png", ".jsonl") - os.truncate(filepath_jsonl, 0) + if os.path.exists(filepath_jsonl): + os.truncate(filepath_jsonl, 0) i = 0 for input_pair in input_items: