From 75ebb48e62a4e1dc0111c547d5f8c1cc184e70d9 Mon Sep 17 00:00:00 2001 From: Fortas Oussama Ilyes Date: Thu, 11 Feb 2021 00:44:17 +0100 Subject: [PATCH 1/2] added command to save and load the model --- image_recognition_keras_tutorial.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/image_recognition_keras_tutorial.py b/image_recognition_keras_tutorial.py index c89fafd..bd93f66 100644 --- a/image_recognition_keras_tutorial.py +++ b/image_recognition_keras_tutorial.py @@ -76,3 +76,10 @@ scores = model.evaluate(X_test, y_test, verbose=0) print("Accuracy: %.2f%%" % (scores[1]*100)) + +# Save a model +model.save('SavedModel/my_model.tflearn') +print("model saved") + +# Load a model +model.load('SavedModel/my_model.tflearn') From ae4399e5236810c689a6d0681fa33004c1c044b3 Mon Sep 17 00:00:00 2001 From: Fortas Oussama Ilyes Date: Thu, 11 Feb 2021 00:47:22 +0100 Subject: [PATCH 2/2] Added Command to save and load the model --- image_recognition_keras_tutorial.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/image_recognition_keras_tutorial.py b/image_recognition_keras_tutorial.py index bd93f66..6c42a67 100644 --- a/image_recognition_keras_tutorial.py +++ b/image_recognition_keras_tutorial.py @@ -79,7 +79,8 @@ # Save a model model.save('SavedModel/my_model.tflearn') -print("model saved") +print("MODEL SAVED") # Load a model model.load('SavedModel/my_model.tflearn') +print("MODEL LOADED")