tensorflow - x = tf.placeholder(tf.float32,[None,784])是什么意思?

标签 tensorflow

我知道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/

相关文章:

tensorflow - 如何使用 Keras 打开大型 Parquet 文件?

python - 为直方图添加自定义摘要 protobuf

tensorflow - 卷积神经网络和 3D 图像

python-3.x - python tensorflow 中一种热编码的分类级别

tensorflow - 在 google-cloud-ml 上为诗人部署和预测 tensorflow

python - reshape 具有多个未知维度的张量

python - Tensorflow - 我是否正确恢复模型?

java - Android 中的 Tensorflow : java. lang.illegalArgumentsException

machine-learning - 将图像输入 tensorflow

python - 如何将 Tensorflow One Hot 编码与基于 keras 的神经网络结合使用?