【发布时间】:2018-02-02 15:39:05
【问题描述】:
我有这个占位符:
__y = tf.placeholder(tf.int32)
然后我在下面的代码中使用它:
self.session.run(tf.global_variables_initializer())
self.cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels=self.__y, logits=self.super_source))
opt = tf.train.GradientDescentOptimizer(0.1).minimize(self.cost)
not_important, c = self.session.run(opt, feed_dict={labels: label})
我得到这个错误:
InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'Placeholder' with dtype int32
[[Node: Placeholder = Placeholder[dtype=DT_INT32, shape=<unknown>, _device="/job:localhost/replica:0/task:0/gpu:0"]()]]
我不明白我得到的错误,所以我无法解决我的问题。有人可以至少解释一下发生了什么吗?
【问题讨论】:
标签: python tensorflow placeholder