Tensorflow您必须为占位符张量提供一个值' Placeholder'与dtype布尔

时间:2017-01-11 18:13:15

标签: tensorflow

我为第二个受访者运行代码并发现错误。 tensorflow batch normalizatioon second respondents 错误图片

enter image description here

1 个答案:

答案 0 :(得分:2)

运行操作时,必须为feed_dict提供值。

以下是一个示例程序:

import tensorflow as tf

# Define the inputs you will feed into the tensorflow computation graph
a = tf.placeholder(tf.int32, shape=[1], name="a")
x = tf.placeholder(tf.int32, shape=[4], name="x")
# This is the actual computation we want to run.
output = a * x

with tf.Session() as sess:
  # Actually run the computation, feeding in [10] for a, and [1, 2, 3, 4] for x.
  # This will print out: [10 20 30 40]
  print sess.run(output, feed_dict={a: [10], x: [1, 2, 3, 4]})