这个报错是因为sess.run(a,b,c)里要运行的多个变量没有用中括号括起来
举个错误的例子:下面报错是因为sess.run里的c和d没有用中括号
import tensorflow as tfa = tf.placeholder(tf.float32, [1])
b = tf.placeholder(tf.float32, [1])
c = tf.multiply(a, b)
d = tf.add(a, b)with tf.Session() as sess:prod, sum_ab = sess.run(c, d, {a: [1.], b: [2.]})print(prod, sum_ab)
应该将后面那段程序改成:
with tf.Session() as sess:prod, sum_ab = sess.run([c, d], {a: [1.], b: [2.]})print(prod, sum_ab)