DeepLabV3+: close each matplotlib figure after writing it

This commit is contained in:
Starbeamrainbowlabs 2022-12-15 19:14:07 +00:00
parent 6ce121f861
commit 15a3150127
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -181,24 +181,28 @@ plt.title("Training Loss")
plt.ylabel("loss") plt.ylabel("loss")
plt.xlabel("epoch") plt.xlabel("epoch")
plt.savefig(os.path.join(DIR_OUTPUT, "loss.png")) plt.savefig(os.path.join(DIR_OUTPUT, "loss.png"))
plt.close()
plt.plot(history.history["accuracy"]) plt.plot(history.history["accuracy"])
plt.title("Training Accuracy") plt.title("Training Accuracy")
plt.ylabel("accuracy") plt.ylabel("accuracy")
plt.xlabel("epoch") plt.xlabel("epoch")
plt.savefig(os.path.join(DIR_OUTPUT, "acc.png")) plt.savefig(os.path.join(DIR_OUTPUT, "acc.png"))
plt.close()
plt.plot(history.history["val_loss"]) plt.plot(history.history["val_loss"])
plt.title("Validation Loss") plt.title("Validation Loss")
plt.ylabel("val_loss") plt.ylabel("val_loss")
plt.xlabel("epoch") plt.xlabel("epoch")
plt.savefig(os.path.join(DIR_OUTPUT, "val_loss.png")) plt.savefig(os.path.join(DIR_OUTPUT, "val_loss.png"))
plt.close()
plt.plot(history.history["val_accuracy"]) plt.plot(history.history["val_accuracy"])
plt.title("Validation Accuracy") plt.title("Validation Accuracy")
plt.ylabel("val_accuracy") plt.ylabel("val_accuracy")
plt.xlabel("epoch") plt.xlabel("epoch")
plt.savefig(os.path.join(DIR_OUTPUT, "val_acc.png")) plt.savefig(os.path.join(DIR_OUTPUT, "val_acc.png"))
plt.close()