Skip to content

Commit

Permalink
Call layer-serialization function only once per layer, closes #98
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobiasd committed Nov 29, 2018
1 parent a2a9783 commit 1b09382
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions keras_export/convert_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,11 @@ def get_all_weights(model):
assert is_ascii(name)
if name in result:
raise ValueError('duplicate layer name ' + name)
if show_func and show_func(layer) != None:
result[name] = show_func(layer)
shown_layer = None
if show_func:
shown_layer = show_func(layer)
if shown_layer:
result[name] = shown_layer
if show_func and layer_type == 'TimeDistributed':
if name not in result:
result[name] = {}
Expand Down

0 comments on commit 1b09382

Please sign in to comment.