Skip to content

error saving trained model when eager is disabled #3

@naodaihuang

Description

@naodaihuang

After successfully trained model with STLSTM layer, when I tried to save the model in keras, got the following error:

Error in py_call_impl(callable, dots$args, dots$keywords) :
ValueError: tf.function-decorated function tried to create variables on non-first call.

I had to disable eager execution in my code for compatibility reasons, which could be causing the problem:
tf.compat.v1.disable_eager_execution()
tf.compat.v1.disable_control_flow_v2()

How can we fix it? Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions