title: Using embedding layer with GRU
body: <p>I have a working code using GRU creating the input manually as a 3D array (None,10,64). The code is:</p>
  
  <pre><code>model = Sequential()
  model.add(GRU(300, return_sequences=False, input_shape=(None, 64)))
  model.add(Dropout(0.8)) 
  model.add(Dense(64, input_dim=300))       
  model.add(Activation("linear"))
  </code></pre>
  
  <p>This returns the predicted embedding given the input window. Now I want to use the keras embedding layer on top of GRU. My idea is to input a 2D array (None, 10) and use the embedding layer to convert each sample to the corresponding embedding vector.</p>
  
  <p>So now I have this:</p>
  
  <pre><code>model = Sequential()
  model.add(Embedding(vocab_size, 64, weights=[embedding_matrix], input_length=10, trainable=False))
  model.add(GRU(300, return_sequences=False))
  model.add(Dropout(0.8)) 
  model.add(Dense(64))  
  model.add(Activation("linear")) 
  </code></pre>
  
  <p>I see from the summary that the output of the embedding layer is:</p>
  
  <pre><code>embedding_2 (Embedding)      (None, 10, 64) 
  </code></pre>
  
  <p>which is what I expected. But when I try to fit the model I get this error:</p>
  
  <pre><code>expected activation_2 to have shape (64,) but got array with shape (1,)
  </code></pre>
  
  <p>If I comment the other layers and leave only the embedding and gru I get:</p>
  
  <pre><code>expected gru_5 to have shape (300,) but got array with shape (1,)
  </code></pre>
  
  <p>So my question is what is the difference between fitting a manually constructed 3D array and an embedding layer generated one?.</p>