Skip to content

Commit

Permalink
fixed docs for Sequential.get_config, and added a more helpful (#2635)
Browse files Browse the repository at this point in the history
exception to `model_from_config`.
  • Loading branch information
cmyr authored and fchollet committed May 5, 2016
1 parent 5749f1b commit 7b4e157
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion keras/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down Expand Up @@ -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':
Expand Down

0 comments on commit 7b4e157

Please sign in to comment.