AttributeError: module'tensorflow' has no attribute'session' solution

Program to be tested:

import tensorflow as tf 
hello =tf.constant('hello, tensorflow')
#print('Hello python')
sess = tf.session()

The problem description continues. I did not expect that the problem of cudart64_110.dll not found was solved and the problem of AttributeError: module'tensorflow' has no attribute'session' appeared.

Inquiry through the Internet, https://blog.csdn.net/sinat_36502563/article/details/102302392

Put:

sess = tf.session()

To

sess = tf.compat.v1.Session()

That's it.

 

Guess you like

Origin blog.csdn.net/a1456123a/article/details/115097982