title: How to generate sequence data with keras with multiple input?
body: <p>I'm writing a VAE for sequence to sequence problem in keras. The decoder is an auto-regressive model so I have two different inputs, one for the encoder and the same (shifted by 1, but this is not the problem) for the decoder.
  I want also to do data augmentation so I decide to use the fit_generator() method but I have some problem on returning the two inputs. </p>
  
  <p>I have tried to return a list of two input vector, like this</p>
  
  <pre class="lang-py prettyprint-override"><code>class DataGenerator(Sequence):
      def __init__(....
  
      def __getitem__(self, index):
          data = create_data()
          return  [data, data]
  </code></pre>
  
  <p>or a dictionary like this</p>
  
  <pre class="lang-py prettyprint-override"><code>return {"encoder_input_name" : "data, decoder_input_name" : data } 
  </code></pre>
  
  <p>where data is a numpy tensor of shape (batch_size, max_sequence_len, input_dimention). </p>
  
  <p>I can't just use the same input layer because later the two input will be a little different, as I said the decoder input will be shifted by one with a different first element and other reasons.</p>
  
  <p>When I return the list [data, data] or  I have this error:</p>
  
  <pre><code>ValueError: Error when checking model input: the list of Numpy arrays that you are passing to your model is not the size the model expected. Expected to see 2 array(s), but instead got the following list of 1 arrays
  </code></pre>
  
  <p>When I return the dictionary I have this error:</p>
  
  <pre><code>batch_size = x.shape[0]
  AttributeError: 'str' object has no attribute 'shape'
  </code></pre>
  
  <p>How can I solve this issue?</p>
  
  <p>Thank you very much!</p>
  
  <p>EDIT</p>
  
  <p>I changed the output of <code>__getitem__</code> to 
  <code>[inpuut_1, input_2], []</code> and it worked.</p>