title: model.compile() fails with every but 'accuracy' metric
body: <p>I am working on a simple MLP, and coded this:</p>
  <pre><code>from keras.models import Sequential
  from keras.layers import Dense
  from keras import Input
  
  def get_stats_model():
  
      model = Sequential()
      model.add(Dense(12, input_dim=8, activation='relu'))
      model.add(Dense(8, activation='relu'))
      model.add(Dense(1, activation='sigmoid'))
      model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
      
      return model
  </code></pre>
  <p>And in <code>main.py</code>:</p>
  <pre><code>get_stats_model()
  </code></pre>
  <p>Which works perfectly, as long as the metrics is <code>'accuracy'</code> only. when trying with both <code>'accuracy'</code> and <code>'AUC'</code>, just <code>'AUC'</code>, or <code>'mean_absolute_error'</code>, like:</p>
  <pre><code>from keras.models import Sequential
  from keras.layers import Dense
  from keras import Input
  
  def get_stats_model():
  
      model = Sequential()
      model.add(Dense(12, input_dim=8, activation='relu'))
      model.add(Dense(8, activation='relu'))
      model.add(Dense(1, activation='sigmoid'))
      model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['AUC'])
      
      return model
  
  </code></pre>
  <p>I get the following error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;main.py&quot;, line 4, in &lt;module&gt;
      get_stats_model()
    File &quot;/home/giuliano/Desktop/tfg/workspace/root/final/exp/mlp.py&quot;, line 64, in get_stats_model
      model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['AUC'])
    File &quot;/home/giuliano/anaconda3/envs/tfg/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py&quot;, line 75, in symbolic_fn_wrapper
      return func(*args, **kwargs)
    File &quot;/home/giuliano/anaconda3/envs/tfg/lib/python3.7/site-packages/keras/engine/training.py&quot;, line 222, in compile
      masks=masks)
    File &quot;/home/giuliano/anaconda3/envs/tfg/lib/python3.7/site-packages/keras/engine/training.py&quot;, line 871, in _handle_metrics
      self._per_output_metrics[i], target, output, output_mask)
    File &quot;/home/giuliano/anaconda3/envs/tfg/lib/python3.7/site-packages/keras/engine/training.py&quot;, line 842, in _handle_per_output_metrics
      metric_fn, y_true, y_pred, weights=weights, mask=mask)
    File &quot;/home/giuliano/anaconda3/envs/tfg/lib/python3.7/site-packages/keras/engine/training_utils.py&quot;, line 1033, in call_metric_function
      update_ops = metric_fn.update_state(y_true, y_pred, sample_weight=weights)
    File &quot;/home/giuliano/anaconda3/envs/tfg/lib/python3.7/site-packages/keras/utils/metrics_utils.py&quot;, line 42, in decorated
      update_op = update_state_fn(*args, **kwargs)
    File &quot;/home/giuliano/anaconda3/envs/tfg/lib/python3.7/site-packages/keras/metrics.py&quot;, line 318, in update_state
      matches = self._fn(y_true, y_pred, **self._fn_kwargs)
    File &quot;/home/giuliano/anaconda3/envs/tfg/lib/python3.7/site-packages/keras/metrics.py&quot;, line 1660, in __init__
      if num_thresholds &lt;= 1:
    File &quot;/home/giuliano/anaconda3/envs/tfg/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py&quot;, line 757, in __bool__
      self._disallow_bool_casting()
    File &quot;/home/giuliano/anaconda3/envs/tfg/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py&quot;, line 526, in _disallow_bool_casting
      self._disallow_in_graph_mode(&quot;using a `tf.Tensor` as a Python `bool`&quot;)
    File &quot;/home/giuliano/anaconda3/envs/tfg/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py&quot;, line 515, in _disallow_in_graph_mode
      &quot; this function with @tf.function.&quot;.format(task))
  tensorflow.python.framework.errors_impl.OperatorNotAllowedInGraphError: using a `tf.Tensor` as a Python `bool` is not allowed in Graph execution. Use Eager execution or decorate this function with @tf.function.
  
  </code></pre>
  <p>And I just can't figure out why the only change in metrics is causing such error, and there doesn't seem to be much information on the internet.</p>
  <p>My packages versions are:</p>
  <pre><code>Keras==2.3.1
  tensorflow==2.1.0
  </code></pre>
  <p>Thanks in advance.</p>