Skip to content

Commit

Permalink
Fix issue with cascade of Merge layers
Browse files Browse the repository at this point in the history
  • Loading branch information
fchollet committed Jun 13, 2016
1 parent 3b83a1b commit c9aee41
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion keras/engine/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,10 @@ def collect_trainable_weights(layer):
if not trainable:
return []
weights = []
if layer.__class__.__name__ in ['Sequential', 'Model']:
if layer.__class__.__name__ == 'Sequential':
for sublayer in layer.flattened_layers:
weights += collect_trainable_weights(sublayer)
elif layer.__class__.__name__ == 'Model':
for sublayer in layer.layers:
weights += collect_trainable_weights(sublayer)
elif layer.__class__.__name__ == 'Graph':
Expand Down

0 comments on commit c9aee41

Please sign in to comment.