Error when I use Execute line in python console
Answered
Hello,
I am facing a weird error when I want to run a part of my code using "Execute line in python console"
I am using TensorFlow 2.5, and when I run my code in console (green button, top right) there is no problem, but weirdly when I select a specific line of code and use "Execute line in python console" I get the following error.
Could you please let me know what can be the possible problem?
Is there any difference between running code using "Execute line in python console" and "run in console"?
ssl_ds_one = (
ssl_ds_one.shuffle(1024, seed=SEED)
.map(custom_augment, num_parallel_calls=AUTO)
.batch(BATCH_SIZE)
.prefetch(AUTO)
)
tensorflow.python.framework.errors_impl.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.
Please sign in to leave a comment.
So when you click the Run button, do you see the Run window or the Python Console window?
Please provide code and steps for reproducing the problem.