Save/Load models using HDF5 files
save_model_hdf5(object, filepath, overwrite = TRUE,
include_optimizer = TRUE)load_model_hdf5(filepath, custom_objects = NULL, compile = TRUE)
Model object to save
File path
Overwrite existing file if necessary
If TRUE
, save optimizer's state.
Mapping class names (or function names) of custom (non-Keras) objects to class/functions
Whether to compile the model after loading.
The following components of the model are saved:
The model architecture, allowing to re-instantiate the model.
The model weights.
The state of the optimizer, allowing to resume training exactly where you left off. This allows you to save the entirety of the state of a model in a single file.
Saved models can be reinstantiated via load_model()
. The model returned by
load_model()
is a compiled model ready to be used (unless the saved model
was never compiled in the first place or compile = FALSE
is specified.
Other model persistence: get_weights
,
model_to_json
, model_to_yaml
,
save_model_weights_hdf5