小编sma*_*ing的帖子

当启用 eager execution 时,Tensor.graph 没有意义

a = tf.compat.v1.constant(5.0)
b = tf.compat.v1.constant(6.0)

sum1 = a + b
g = tf.compat.v1.Graph()
with g.as_default():
    # Define operations and tensors in `g`.
    hello = tf.compat.v1.constant('hello')
    assert hello.graph is g

sess = tf.compat.v1.Session(graph=g)

print(sess.run(sum1))


Run Code Online (Sandbox Code Playgroud)

tensorflow-gpu2.0 我不知道为什么。我是张量流的初学者

python tensorflow

2
推荐指数
1
解决办法
8002
查看次数

标签 统计

python ×1

tensorflow ×1