Steve
Steve

Reputation: 149

Module 'tensorflow' has no attribute 'enable_eager_execution' - with TensorFlow 2.6

I have TensorFlow 2.6 installed with Python 3.9. However, I get the following errors:

tf.enable_eager_execution()

AttributeError: module 'tensorflow' has no attribute 'enable_eager_execution'

When I run tf.executing_eagerly() I get False.

I reinstalled TensorFlow and I'm still getting the same errors.

Upvotes: 1

Views: 1858

Answers (1)

shreyasm-dev
shreyasm-dev

Reputation: 2844

In TensorFlow 2 and above, eager execution should be already enabled by default. You can check that with tf.executing_eagerly(). Only use tf.enable_eager_execution() if running a version of Tensorflow before 2.0

Upvotes: 1

Related Questions