I\'m trying to understand placeholders in tensorflow. Specifically what shape=[None,
means in the example below.
X = tf.placeholder(tf.float32,
The first dimension represents the number of samples (images in your case). The reason why you do not want to hardcode a specific number there is to keep things flexible and allow for any number of samples. By putting None
as the first dimension of the tensor you enable that. Consider the following 3 very common actions:
All of these will work with a different number of samples in general. However, you do not have to worry because the None
got you covered.