# Load a saved model - DL
Data Science for Political and Social Phenomena
Author: Guillaume Redoulès

# Load a saved model

A keras model can be loaded from a hdf5 file. Becareful, a keras generated hdf5 can contain either :

- the model weights (obtained by the `.save_weights()` method)
- the model weights and the model architecture (obtained by the `.save()` method)

In our case, we will load both the model and its weights with the `load_model` function from the `keras.models` module

    from keras.models import load_model

    model = load_model("my_model.h5")
    type(model)

    keras.engine.sequential.Sequential

### Find an error or bug? Have a suggestion?

Everything on this site is avaliable on GitHub. Head on over and submit an issue. You can also message me directly by email.