title: Keras - Input a 3 channel image into LSTM
body: <p>I have read a sequence of images into a numpy array with shape <code>(7338, 225, 1024, 3)</code> where <code>7338</code> is the sample size, <code>225</code> are the time steps and <code>1024 (32x32)</code> are flattened image pixels, in <code>3</code> channels (RGB).</p>
  
  <p>I have a sequential model with an LSTM layer:</p>
  
  <pre><code>model = Sequential()
  model.add(LSTM(128, input_shape=(225, 1024, 3))
  </code></pre>
  
  <p>But this results in the error:</p>
  
  <pre><code>Input 0 is incompatible with layer lstm_1: expected ndim=3, found ndim=4
  </code></pre>
  
  <p>The <a href="https://keras.io/layers/recurrent/" rel="noreferrer">documentation</a> mentions that the input tensor for LSTM layer should be a <code>3D tensor with shape (batch_size, timesteps, input_dim)</code>, but in my case my <code>input_dim</code> is 2D.</p>
  
  <p>What is the suggested way to input a 3 channel image into an LSTM layer  in Keras?</p>