TensorFlow:评估具有负维度的张量切片

时间:2017-06-27 04:08:37

标签: tensorflow

使用具有未指定尺寸的占位符,如何切割矢量并打印它?

x = tf.placeholder(tf.float32, [None, 784])
for ep in range(1000):
    batch_xs, batch_ys = mnist.train.next_batch(100)
    sess.run(train_step, feed_dict={x: batch_xs, y_: batch_ys})
    sl = tf.slice(y, [0,0], [1,784])

sess.run(sl)sl.eval()会生成InvalidArgumentError消息Shape [-1,784] has negative dimensions

0 个答案:

没有答案