我知道tf.placeholder的基本用法:
x = tf.placeholder(tf.float32, shape=(1024, 1024))
y = tf.matmul(x, x)
with tf.Session() as sess:
print(sess.run(y)) # ERROR: will fail because x was not fed.
rand_array = np.random.rand(1024, 1024)
print(sess.run(y, feed_dict={x: rand_array})) # Will succeed.
我知道第二个参数是关于 shape 的。但是,我不知道第一个形状为时是什么意思。例如:[无,784]。
最佳答案
在本教程中:Deep MNIST for Experts
Here we assign it a shape of [None, 784], where 784 is the dimensionality of a single flattened 28 by 28 pixel MNIST image, and None indicates that the first dimension, corresponding to the batch size, can be of any size.
关于tensorflow - x = tf.placeholder(tf.float32,[None,784])是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39305174/