OperatorNotAllowedInGraphError: using a `tf.Tensor` as a Python `bool` is not allowed in Graph execution. Use Eager execution or decorate this function with @tf.function

Hello! Can you please explain how you solved the error? I am encountering it too.

1 Like