title: LSTM keras - Value error how to resolve input dimension
body: <p>I have made a function for training data which pick random files either positive or negative. it is a binary classification problem.</p>
  
  <pre><code>    model=Sequential()
  InputBatch = np.expand_dims(InputBatch, 0)
  print(InputBatch.shape)
  model.add(LSTM(100,input_shape=(1,6,30),return_sequences=True))
  model.compile(loss='mean_absolute_error',optimizer='adam',metrics=['accuracy'])
  model.fit(InputBatch,PositiveOrNegativeLabel,batch_size=6,nb_epoch=10,verbose=1,validation_split=0.05)
  </code></pre>
  
  <p>the shape of InputBatch variable is (1,6,30) </p>
  
  <p>for example my input data is </p>
  
  <pre><code>[[   nan  1520.  1295.    nan  8396.  9322. 12715.    nan  5172.  7232.
    11266.    nan 11266.  2757.  4416. 12020. 12111.     0.     0.     0.
        0.     0.     0.     0.     0.     0.     0.     0.     0.     0.]
   [   nan  3045. 11480.   900.  5842. 11496.  4463.    nan 11956.   900.
    10400.  8022.  2504. 12106.     0.     0.     0.     0.     0.     0.
        0.     0.     0.     0.     0.     0.     0.     0.     0.     0.]
   [   nan  9307. 12003.  2879.  6398.  9372.  4614.  5222.    nan    nan
     2879. 10364.  6923.  4709.  4860. 11871.     0.     0.     0.     0.
        0.     0.     0.     0.     0.     0.     0.     0.     0.     0.]
   [   nan  6689.  2818. 12003.  6480.    nan     0.     0.     0.     0.
        0.     0.     0.     0.     0.     0.     0.     0.     0.     0.
        0.     0.     0.     0.     0.     0.     0.     0.     0.     0.]
   [   nan  3395.  1087. 11904.  7232.  8840. 10115.  4494. 11516.  7441.
     8535. 12106.     0.     0.     0.     0.     0.     0.     0.     0.
        0.     0.     0.     0.     0.     0.     0.     0.     0.     0.]
   [   nan  1287.   420.  4070. 11087.  7410. 12186.  2387. 12111.     0.
        0.     0.     0.     0.     0.     0.     0.     0.     0.     0.
        0.     0.     0.     0.     0.     0.     0.     0.     0.     0.]]
  </code></pre>
  
  <p>I have set the shape of data which is (6,30)</p>
  
  <p>I am getting value error </p>
  
  <pre><code>ValueError: Error when checking input: expected lstm_16_input to have 3 dimensions, but got array with shape (1,6, 30)
  </code></pre>
  
  <p><strong>it is getting three dimension input i don't understand how and why</strong></p>