张量流中的feed_dict错误

时间:2018-01-26 17:07:08

标签: tensorflow summary

我是tensorflow的新学习者,我的代码出错了。

merged = tf.summary.merge_all()
with tf.Session() as sess:
     sess.run(init)
     writer = tf.summary.FileWriter('logs/', sess.graph)
     for epoch in range(21):
         for batch in range(n_batch):
             batch_xs, batch_ys = minst.train.next_batch(batch)
             summary, _ = sess.run([merged, train_step], feed_dict={x:batch_xs, y:batch_ys})

错误是最后一行。 tensorflow给出了这个错误信息:

InvalidArgumentError: You must feed a value for placeholder tensor 'input_1/y_input' with dtype float and shape [?,10]
 [[Node: input_1/y_input = Placeholder[dtype=DT_FLOAT, shape=[?,10], _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]

 During handling of the above exception, another exception occurred:

 InvalidArgumentError                      Traceback (most recent call last)
 <ipython-input-18-794785aaa402> in <module>()
      60         for batch in range(n_batch):
      61             batch_xs, batch_ys = minst.train.next_batch(batch)
 ---> 62             summary, _ = sess.run([merged, train_step], feed_dict={x:batch_xs, y:batch_ys})

请帮我弄清楚出了什么问题。感谢。

0 个答案:

没有答案