title: What's the difference between input_shape and batch_input_shape in LSTM
body: <p>Is it just a different way of setting the same thing or do they actually have different meanings? Does it have anything to do with network configuration?</p>
  
  <p>On a simple example, I couldn't observe any difference between:</p>
  
  
  
  <pre class="lang-python prettyprint-override"><code>model = Sequential()
  model.add(LSTM(1, batch_input_shape=(None,5,1), return_sequences=True))
  model.add(LSTM(1, return_sequences=False))
  </code></pre>
  
  <p>and</p>
  
  <pre class="lang-python prettyprint-override"><code>model = Sequential()
  model.add(LSTM(1, input_shape=(5,1), return_sequences=True))
  model.add(LSTM(1, return_sequences=False))
  </code></pre>
  
  <p>However when I set the batch size to 12 <code>batch_input_shape=(12,5,1)</code> and used <code>batch_size=10</code> when fitting the model, I got an error.</p>
  
  <blockquote>
    <p>ValueError: Cannot feed value of shape (10, 5, 1) for Tensor
    'lstm_96_input:0', which has shape '(12, 5, 1)'</p>
  </blockquote>
  
  <p>Which obviously makes sense. However I can see no point in restricting the batch size on model level.</p>
  
  <p>Am I missing something?</p>