0

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:

1 Answer 1

1

The solution that I found is:

import tensorflow.python.framework.ops as tf_ops

...

if S.__class__ == tf_ops.EagerTensor:
Sign up to request clarification or add additional context in comments.

2 Comments

You should use if isinstance(S, tf_ops.EagerTensor) in any case.
@AKX thank you, nice to know

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.