from tensorflow.contrib.learn.python.learn.estimators import tensor_signature

      if not tensor_signature.tensors_compatible(targets, self._targets_info):
        raise ValueError('Targets are incompatible with given information. '
                         'Given targets: %s, required signatures: %s.' %
                         (str(targets), str(self._targets_info)))
    else:
      self._targets_info = tensor_signature.create_signatures(targets)

  def _train_model(self,
                   input_fn,
                   steps,
