装好的tensorflow实属不易,奈何测试出了问题,原来是2.0版本不兼容1.0,看一下这个博客吧,亲测有效。
import tensorflow as tf
tf.compat.v1.disable_eager_execution() #保证sess.run()能够正常运行
hello = tf.constant('hello,tensorflow')
sess= tf.compat.v1.Session()#版本2.0的函数
print(sess.run(hello))
https://blog.csdn.net/weixin_38410551/article/details/103631977