title: Keras input_shape for conv2d and manually loaded images
body: <p>I am manually creating my dataset from a number of 384x286 b/w images.</p>
  
  <p>I load an image like this:</p>
  
  <pre><code>x = []
  for f in files:
          img = Image.open(f)
          img.load()
          data = np.asarray(img, dtype="int32")
          x.append(data)
  x = np.array(x)
  </code></pre>
  
  <p>this results in x being an array (num_samples, 286, 384)</p>
  
  <pre><code>print(x.shape) =&gt; (100, 286, 384)
  </code></pre>
  
  <p>reading the keras documentation, and checking my backend, i should provide to the convolution step an input_shape composed by ( rows, cols, channels )</p>
  
  <p>since i don't arbitrarily know the sample size, i would have expected to pass as an input size, something similar to</p>
  
  <pre><code>( None, 286, 384, 1 )
  </code></pre>
  
  <p>the model is built as follows:</p>
  
  <pre><code>model = Sequential()
  model.add(Conv2D(32, kernel_size=(3, 3), activation='relu', input_shape=input_shape))
  # other steps...
  </code></pre>
  
  <p>passing as input_shape (286, 384, 1) causes:</p>
  
  <blockquote>
    <p>Error when checking input: expected conv2d_1_input to have 4 dimensions, but got array with shape (85, 286, 384)</p>
  </blockquote>
  
  <p>passing as_input_shape (None, 286, 384, 1 ) causes:</p>
  
  <blockquote>
    <p>Input 0 is incompatible with layer conv2d_1: expected ndim=4, found ndim=5</p>
  </blockquote>
  
  <p>what am i doing wrong ? how do i have to reshape the input array?</p>