Complete the code to save a TensorFlow model in SavedModel format.
model.save('[1]')
To save a TensorFlow model in SavedModel format, you provide a directory path. The path 'saved_model/my_model' is a folder where the model will be saved.
Complete the code to load a TensorFlow model saved in SavedModel format.
loaded_model = tf.keras.models.[1]('saved_model/my_model')
To load a model saved in SavedModel format, use tf.keras.models.load_model() with the folder path.
Fix the error in the code to save the model in SavedModel format.
model.save('my_model[1]')
To save in SavedModel format, the path should be a directory. Adding a slash '/' at the end ensures it's treated as a folder.
Fill both blanks to save a model and then load it back correctly.
model.save('[1]') loaded_model = tf.keras.models.[2]('[1]')
Use the same folder path to save and load the model. Use load_model to load the full model from SavedModel format.
Fill all three blanks to save a model, load it, and evaluate it on test data.
model.save('[1]') loaded_model = tf.keras.models.[2]('[1]') loss, accuracy = loaded_model.evaluate([3])
Save and load the model using the same folder path and load_model. Then evaluate the loaded model on the test dataset.