image-segmentation-keras icon indicating copy to clipboard operation
image-segmentation-keras copied to clipboard

How to save a trained model?

Open peijason opened this issue 4 years ago • 4 comments

Haven't seen any description on the Front Page about how to save a trained model?

peijason avatar Aug 21 '20 21:08 peijason

you can use keras model.save_weights function.

divamgupta avatar Aug 23 '20 07:08 divamgupta

Just want to mention that model.save() is currently not supported (see #149). I think a good explanation how to save and load a model can be found here on stackoverflow.

theo258 avatar Sep 01 '20 13:09 theo258

I saved the model architecture via model.to_json, but when i tried to reload via model_from_json, i encountered the error "ValueError: Unknown layer: Interp". I supposed this is due to the custom class "Interp" in the model.

Tried to resolve it by model_from_json(json_string, custom_objects={'Interp': Interp}), but a new error "name 'Interp' is not defined" show up.

How can i reload the model so that i can deploy it elsewhere?

Kian-Soon avatar Feb 09 '21 16:02 Kian-Soon

any news on this? I'm stucked here. I tried using model.save and load but it isn't working: super good performance when training/evaluating, but then, if I save the model and load it again it makes no sense.

save_weigths will also save your weights and not the architecture, is there a way to save the architecture as well?

rola93 avatar Jun 09 '21 21:06 rola93