message: keras/training.py: Improve error message.
  Inspired by:
diff: @@ -383,27 +383,31 @@ class Model(Network):
  """
  # Validate that arguments passed by the user to `compile` are supported by
  # DistributionStrategy.
  - if distribute and not isinstance(
  + if distribute:
  + if not isinstance(
  optimizer, (tf_optimizer_module.Optimizer, optimizers.TFOptimizer)):
  - raise NotImplementedError('Only TF native optimizers are supported with '
  - 'DistributionStrategy.')
  - if distribute and context.executing_eagerly():
  - raise NotImplementedError('DistributionStrategy is not supported in '
  - 'Eager mode.')
  - if distribute and sample_weight_mode:
  + raise NotImplementedError(
  + 'optimizer must be an instance of '
  + 'tf.train.Optimizer, not a %s' % type(optimizer))
  + if context.executing_eagerly():
  + raise NotImplementedError('DistributionStrategy is not supported '
  + 'when eager execution is enabled.')
  + if sample_weight_mode:
  raise NotImplementedError('sample_weight_mode is not supported with '
  'DistributionStrategy.')
  - if distribute and weighted_metrics:
  + if weighted_metrics:
  raise NotImplementedError('weighted_metrics is not supported with '
  'DistributionStrategy.')
  - if distribute and target_tensors:
  + if target_tensors:
  raise ValueError('target_tensors is not supported with '
  'DistributionStrategy.')
  loss = loss or {}
  if context.executing_eagerly() and not isinstance(
  optimizer, (tf_optimizer_module.Optimizer, optimizers.TFOptimizer)):
  - raise ValueError('Only TF native optimizers are supported in Eager mode.')
  + raise ValueError(
  + 'optimizer must be an instance of tf.train.Optimizer, not '
  + 'a %s' % type(optimizer))
  self.optimizer = optimizers.get(optimizer)
  # We've disabled automatic dependency tracking for this method, but do want
  