ChaosPredictor
ChaosPredictor

Reputation: 4091

AttributeError: module 'tensorflow' has no attribute 'python' error after update

I worked with tf 2.3, after an update to 2.6 got the following error

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

in line:

if S.__class__ == tf.python.framework.ops.EagerTensor:

Upvotes: 0

Views: 1233

Answers (1)

ChaosPredictor
ChaosPredictor

Reputation: 4091

The solution that I found is:

import tensorflow.python.framework.ops as tf_ops

...

if S.__class__ == tf_ops.EagerTensor:

Upvotes: 1

Related Questions