TypeError:无法将int32转换为张量或运算

时间:2018-06-22 10:43:36

标签: python tensorflow

我正在python 3.6上运行以下命令:

import tensorflow as tf
x = 2
y = 3
add_op = tf.add(x, y)
mul_op = tf.mul(x, y)
useless = tf.mul(x, add_op)
pow_op = tf.pow(add_op, mul_op)
with tf.Session() as sess:
      z, not_useless = sess.run([op3, useless])

并收到此错误:

   TypeError: Can not convert a int32 into a Tensor or Operation.

0 个答案:

没有答案