I have trained a CNN model and I am trying to serve it using a Flask server in localhost as an exe. I want to distribute my model to other people so they can make predictions but I want to hide my training hyperparameters.
For now, I have saved the model specs into a .keras file as it was the recommended format in keras docs. Model Saving guide – Keras Docs. Problem is when I load it and call model.optimizer.get_config() and model.get_config() I can see everything I did while training.
I am looking for a way/ways to just save what is required for making inferences, which I assume is just the model architecture(the layers involved) and the associated weights. Browsed several forums and read through keras docs. There is plenty of information on how to save everything (architecture, weights, hyperparams, dropout, loss, optimizer…) but not how to save specific things. Also, after saving them, how can I load them back correctly and make predictions?
what is the best way to achieve this? ( I use keras 2.10.0 and tf 2.10.1 )