From 15a3150127bee6ad576fcba58f0e98be52971986 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Thu, 15 Dec 2022 19:14:07 +0000 Subject: [PATCH] DeepLabV3+: close each matplotlib figure after writing it --- aimodel/src/deeplabv3_plus_test.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aimodel/src/deeplabv3_plus_test.py b/aimodel/src/deeplabv3_plus_test.py index 0644e6c..2633398 100755 --- a/aimodel/src/deeplabv3_plus_test.py +++ b/aimodel/src/deeplabv3_plus_test.py @@ -181,24 +181,28 @@ plt.title("Training Loss") plt.ylabel("loss") plt.xlabel("epoch") plt.savefig(os.path.join(DIR_OUTPUT, "loss.png")) +plt.close() plt.plot(history.history["accuracy"]) plt.title("Training Accuracy") plt.ylabel("accuracy") plt.xlabel("epoch") plt.savefig(os.path.join(DIR_OUTPUT, "acc.png")) +plt.close() plt.plot(history.history["val_loss"]) plt.title("Validation Loss") plt.ylabel("val_loss") plt.xlabel("epoch") plt.savefig(os.path.join(DIR_OUTPUT, "val_loss.png")) +plt.close() plt.plot(history.history["val_accuracy"]) plt.title("Validation Accuracy") plt.ylabel("val_accuracy") plt.xlabel("epoch") plt.savefig(os.path.join(DIR_OUTPUT, "val_acc.png")) +plt.close()