Skip to content

Commit

Permalink
Disallow conversion of models having layers with training==True, issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobiasd committed Jul 5, 2021
1 parent 144c757 commit 48912c3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions keras_export/convert_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,9 @@ def get_all_weights(model, prefix):
layers = model.layers
assert K.image_data_format() == 'channels_last'
for layer in layers:
for node in layer.inbound_nodes:
if "training" in node.call_kwargs:
assert node.call_kwargs["training"] is not True, "Only inference mode is supported."
layer_type = type(layer).__name__
name = prefix + layer.name
assert is_ascii(name)
Expand Down

0 comments on commit 48912c3

Please sign in to comment.