title: Why does Keras gives me different results between model.evaluate, model.predicts & model.fit?
body: <p>I'm working on a project with a resnet50 based dual output model. One output is for the regression task and the second output is for a classification task.  </p>
  
  <p>My main question is about the model evaluation. During the training, I achieve pretty good results on both ouputs on the validation set:<br>
  - Combined loss = 0.32507268732786176<br>
  - Val accuracy = 0.97375<br>
  - Val MSE: 4.1454763   </p>
  
  <p>The model.evaluate gives me the following results on the same set:<br>
  - Combined loss = 0.33064378452301024<br>
  - Val accuracy  = 0.976<br>
  - Val MSE       = 1.2375486  </p>
  
  <p>The model.predict gives me totally differents result (I use scikit-learn to compute the metrics):<br>
  - Val accuracy = 0.45875<br>
  - Val MSE: 43.555958365743805<br>
  These last values changes at each predict execution.</p>
  
  <p>I work on TF2.0.
  Here is my code:</p>
  
  <pre class="lang-py prettyprint-override"><code>valid_generator=datagen.flow_from_dataframe(dataframe=df, 
                                              directory=PATH, 
                                              x_col="X", 
                                              y_col=["yReg","yCls"],  
                                              class_mode="multi_output", 
                                              target_size=(IMG_SIZE, IMG_SIZE), 
                                              batch_size=batch_size,
                                              subset="validation",
                                              shuffle=False,
                                              workers = 0)
  def generate_data_generator(generator, train=True):
      while True:
          Xi, yi = train_generator.next()
          y2 = []
          for e in yi[1]:
              y2.append(to_categorical(e, 7))
          y2 = np.array(y2)
          if train: # Augmentation for training only
              Xi = Xi.astype('uint8')
              Xi_aug = seq(images=Xi) # imgaug lib needs uint8
              Xi_aug = Xi_aug.astype('float32')
              Xi_aug = preprocess_input(Xi_aug) # resnet50 preprocessing
              yield Xi_aug, [yi[0], y2]
          else: # Validation
              yield preprocess_input(Xi), [yi[0], y2]
  
  
  model.fit_generator(generator=generate_data_generator(train_generator, True),
      steps_per_epoch=STEP_SIZE_TRAIN,
      validation_data=generate_data_generator(valid_generator, False),
      validation_steps=STEP_SIZE_VALID,
      verbose=1, 
      epochs=50, 
      callbacks=[checkpoint, tfBoard],
      )
  </code></pre>
  
  <pre class="lang-py prettyprint-override"><code>evalu = model.evaluate_generator(generate_data_generator(valid_generator, False), steps=STEP_SIZE_VALID)
  print(model.metrics_names)
  print(evalu)
  </code></pre>
  
  <pre class="lang-py prettyprint-override"><code>preds = model.predict_generator(generate_data_generator(valid_generator, False), steps=STEP_SIZE_VALID, workers = 0)
  labels = valid_generator.labels
  
  print("MSE error:", me.mean_squared_error(labels[0], preds[0]))
  print("Accuracy:", me.accuracy_score(labels[1], preds[1].argmax(axis=1)))
  </code></pre>
  
  <p>What am I doing wrong ?</p>
  
  <p>Thanks for the help !</p>