使用具有未指定尺寸的占位符,如何切割矢量并打印它?
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
。