Tensorflow出现”The Session graph is empty. Add operations to the graph before calling run()“的解决方法
在Tensorflow 2环境下运行以下代码的时候遇到了”The Session graph is empty. Add operations to the graph before calling run()“的错误。
import tensorflow as tf
a= tf.constant([1.0, 2.0, 3.0], shape=[3], name='a')
b= tf.constant([1.0,2.0,3.0], shape=[3], name= 'b')
c= a+ b
sess
原创
2020-11-09 09:32:07 ·
3763 阅读 ·
1 评论