title: IndexError: tuple index out of range BLSTM
body: <p>Please Help me, i want to generate and evaluating accuracy of text summarize model. When i call the evaluating model and generating text from the vector, i just got error tuple index out of range, and what i know the shape in the model was already customized by me.</p>
  <p>This is the code :</p>
  <pre><code>MAX_LEN = 300
  
  en_shape=np.shape(MAX_LEN,)
  de_shape=np.shape(MAX_LEN,)
  
  def generateText(SentOfVecs):
  SentOfVecs=np.reshape(SentOfVecs,de_shape)
  kk=&quot;&quot;
  for k in SentOfVecs:
      kk = kk + label_encoder.inverse_transform([argmax(k)])[0].strip()+&quot; &quot;
      #kk=kk+((getWord(k)[0]+&quot; &quot;) if getWord(k)[1]&gt;0.01 else &quot;&quot;)
  return kk
  
  def summarize(article):
  stop_pred = False
  article =  np.reshape(article,(1,en_shape[0],en_shape[1]))
  #get initial h and c values from encoder
  init_state_val = encoder.predict(article)
  target_seq = np.zeros((1,1,de_shape[1]))
  #target_seq =np.reshape(train_data['summaries'][k][0],(1,1,de_shape[1]))
  generated_summary=[]
  while not stop_pred:
      decoder_out,decoder_h,decoder_c= decoder.predict(x=[target_seq]+init_state_val)
      generated_summary.append(decoder_out)
      init_state_val= [decoder_h,decoder_c]
      #get most similar word and put in line to be input in next timestep
      #target_seq=np.reshape(model.wv[getWord(decoder_out)[0]],(1,1,emb_size_all))
      target_seq=np.reshape(decoder_out,(1,1,de_shape[1]))
      if len(generated_summary)== de_shape[0]:
          stop_pred=True
          break
  return generated_summary
  
  def evaluate_summ(article):
  ref=''
  for k in wt(train_data['gold_summary'][article])[:20]:
      ref=ref+' '+k
  gen_sum = generateText(summarize(train_data[&quot;article&quot;][article]))
  print(&quot;-----------------------------------------------------&quot;)
  print(&quot;Original summary&quot;)
  print(ref)
  print(&quot;-----------------------------------------------------&quot;)
  print(&quot;Generated summary&quot;)
  print(gen_sum)
  print(&quot;-----------------------------------------------------&quot;)
  rouge = Rouge155()
  score = rouge.score_summary(ref, gen_sum)
  print(&quot;Rouge1 Score: &quot;,score)
  </code></pre>
  <p>And this was the error i got :</p>
  <pre><code>---------------------------------------------------------------------------
  IndexError                                Traceback (most recent call last)
  &lt;ipython-input-73-033edff49496&gt; in &lt;module&gt;()
  ----&gt; 1 evaluate_summ(10)
        2 
        3 print(generateText(summarize(train_data[&quot;text_clean&quot;][8])))
        4 print(train_data[&quot;gold_summary&quot;][8])
        5 print(train_data[&quot;article&quot;][8])
  
  1 frames
  &lt;ipython-input-72-c6ea0ce23227&gt; in evaluate_summ(article)
       36     for k in wt(train_data['gold_summary'][article])[:20]:
       37         ref=ref+' '+k
  ---&gt; 38     gen_sum = generateText(summarize(train_data[&quot;article&quot;][article]))
       39     print(&quot;-----------------------------------------------------&quot;)
       40     print(&quot;Original summary&quot;)
  
  &lt;ipython-input-72-c6ea0ce23227&gt; in summarize(article)
       14 def summarize(article):
       15     stop_pred = False
  ---&gt; 16     article =  np.reshape(article,(1,en_shape[0],en_shape[1]))
       17     #get initial h and c values from encoder
       18     init_state_val = encoder.predict(article)
  
  IndexError: tuple index out of range
  </code></pre>