Ask or search…
Comment on page

Keras models

You can save and load all kinds of ML models using the binary data storage
However, Keras does not support using io.BytesIO streams, so you will need to use a temporary file on disk to get the job done.
To save a Keras model:'mymodel.h5')
f = open('mymodel.h5', 'rb').read()'mymodel.h5', f)
And, to load it again:
obj ='mymodel.h5')
with open('mymodel.h5', 'wb') as f:
model = load_model('mymodel.h5')