Hello,
I’m a complete newbie and just getting my hands dirty.
Regarding this example: Google Colab
I now find out how to save the generated model:
model_for_inference.compile(
optimizer=keras.optimizers.RMSprop(), # Optimizer
# Minimize loss:
loss=keras.losses.SparseCategoricalCrossentropy(),
# Monitor metrics:
metrics=[keras.metrics.SparseCategoricalAccuracy()],
)
# Save the entire model as a SavedModel.
model_for_inference.save('saved_model/model')
And I think I also found out how to load this model with another Python file like:
model = keras.models.load_model('saved_model/model')
But I don’t found out how to re-use this model.
I plan to send a String of text to it, and then I’ll get the top 3 predicted labels.
How to do this?
cheers
Charlie