【发布时间】:2016-11-19 04:56:27
【问题描述】:
我正在尝试将我正在研究的神经网络的输入批量处理,这样我就可以像在 tensorflow MNIST 教程中那样将它们输入到 tensorflow 中。但是,我无论如何都找不到这样做,并且教程中没有介绍。
input = tf.placeholder(tf.float32, [10, 10])
...
accuracy = tf.reduce_mean(tf.cast(correct, tf.float32))
inputs = #A list containing 50 of the inputs
sess.run(accuracy, feed_dict={input: inputs})
这将引发以下错误:
ValueError: Cannot feed value of shape (50, 10, 10) for Tensor'Placeholder:0', which has shape '(10, 10)'
我明白为什么会出现上述错误,我只是不知道如何让 tensorflow 将我的输入视为一批输入,而不是认为我正在尝试将其全部输入为一个形状。
非常感谢您的帮助!
【问题讨论】:
标签: python neural-network tensorflow