diff --git a/keras/models.py b/keras/models.py index 363d6c177fd..96d01c19a62 100644 --- a/keras/models.py +++ b/keras/models.py @@ -10,6 +10,10 @@ def model_from_config(config, custom_objects={}): from keras.utils.layer_utils import layer_from_config + if isinstance(config, list): + raise Exception('model_fom_config expects a dictionary.' + 'To load an old-style config use the appropiate' + '`load_config` method on Sequential or Graph') return layer_from_config(config, custom_objects=custom_objects) @@ -699,7 +703,7 @@ def predict_generator(self, generator, val_samples, max_q_size=10): def get_config(self): '''Returns the model configuration - as a Python dictionary. + as a Python list. ''' config = [] if self.layers[0].__class__.__name__ == 'Merge':