title: invalid index to scalar variable as inderError
body: <p>Why do i get this index error?? The error portion code is as follows :</p>
  
  <pre class="lang-py prettyprint-override"><code>t1 = time.time()
  result = model.evaluate_generator(test_generator, steps=steps_epoch)
  t2 = time.time()
  test_time = t2 - t1
  score, accuracy, recall, precision, f1_score = result
  f = open("TP_index_blstm.pkl", 'wb')
  pickle.dump(result[1], f)
  f.close()
  #print(type(result[1]))
  f_TP = open("./result_analyze/BGRU/TP_filenames.txt", "ab+")
  for i in range(len(str(result[1]))):
     TP_index = result[1][i]
     f_TP.write(str(filenames[TP_index]) + '\n')
  
  f_FP = open("./result_analyze/BGRU/FP_filenames.txt", "ab+")
  for j in range(len(str(result[2]))):
     FP_index = result[2][j]
     f_FP.write(str(filenames[FP_index]) + '\n')
  </code></pre>
  
  <p>The error it's showing is as follows:</p>
  
  <pre class="lang-none prettyprint-override"><code>Traceback (most recent call last):
    File "bgru.py", line 240, in &lt;module&gt;
      main(traindataSetPath, testdataSetPath, realtestdataSetPath, weightPath, resultPath, 
         batchSize, maxLen, vectorDim, layers, dropout)
    File "bgru.py", line 153, in main
      TP_index = result[1][i]
  IndexError: invalid index to scalar variable.
  </code></pre>