From e37af12e4aa8654c13a4ce84c574ea2e5db119db Mon Sep 17 00:00:00 2001 From: Mayur Gupta <56781975+coddiction@users.noreply.github.com> Date: Thu, 25 Feb 2021 17:26:47 +0530 Subject: [PATCH] savefig() error fixed In this, savefig() must comes first before plt.show() because if plt.show() is executed then at that point matplotlib resets and that graph data is no more so when the graph is saved in the current directory its just literally blank one. So, to save the actual graph savefig must use before plt.show() Hope, you solve this problem --- face_Recognition.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/face_Recognition.py b/face_Recognition.py index 52f3869..5196008 100644 --- a/face_Recognition.py +++ b/face_Recognition.py @@ -90,8 +90,9 @@ plt.plot(r.history['loss'], label='train loss') plt.plot(r.history['val_loss'], label='val loss') plt.legend() +plt.savefig('LossVal_loss.png') plt.show() -plt.savefig('LossVal_loss') + # accuracies plt.plot(r.history['acc'], label='train acc')