class_docstr: base class for classfication 
docstr: train and eval 
docstr_tok: ["train","and","eval"]
code: def train_and_eval(self):
      """train and eval"""
      nn = self.create_estimator()  # pylint: disable=invalid-name
      # logging.info("Vars: {}".format(nn.get_variable_names()))
  
      # pylint: disable=no-member
      train_spec = tf.estimator.TrainSpec(
          input_fn=self.input_fn(utils.TRAIN),
          max_steps=None,
          hooks=None,
      )
  
      # pylint: disable=no-member
      nclass = self.config["data"]["task"]["classes"]["num"]
      # https://github.com/tensorflow/estimator/blob/master/tensorflow_estimator/python/estimator/canned/metric_keys.py
      if nclass == 2:
          default_key = metric_keys.MetricKeys.AUC
      else:
          default_key = metric_keys.MetricKeys.ACCURACY
      compare_fn = functools.partial(
          utils.metric_smaller, default_key=default_key
      )
      logging.info(f"Using {default_key} metric for best exporter")
  
      eval_spec = tf.estimator.EvalSpec(
          input_fn=self.input_fn(utils.EVAL),
          steps=None,
          name="dev",
          hooks=None,
          exporters=[
              tf.estimator.FinalExporter(
                  name="final_export",
                  serving_input_receiver_fn=self.create_serving_input_receiver_fn(),
                  assets_extra=None,
                  as_text=False,
              ),
              tf.estimator.BestExporter(
                  name="best_exporter",
                  serving_input_receiver_fn=self.create_serving_input_receiver_fn(),
                  event_file_pattern="eval/*.tfevents.*",
                  compare_fn=compare_fn,
                  assets_extra=None,
                  as_text=False,
                  exports_to_keep=1,
              ),
          ],
          start_delay_secs=60,
          throttle_secs=600,
      )
  
      num_epochs = self.config["solver"]["optimizer"]["epochs"]
      for epoch in range(num_epochs):
          logging.info("epoch: {}".format(epoch + 1))
          try:
              self.train_and_eval_one_epoch(nn, train_spec, eval_spec)
          except tf.errors.OutOfRangeError as err:
              logging.info(epoch, err)
              raise err
  
imports: import os
  import re
  import functools
  import collections
  from absl import logging
  import delta.compat
  from tensorflow.python import debug
  from tensorflow.python.estimator.canned import metric_keys
  from tensorboard.plugins.pr_curve import summary
  from delta import utils
  from delta.utils.hparam import HParams
  from delta.utils import metrics
  from delta.utils import summary
  from delta.utils.register import registers
  from delta.utils.solver.base_solver import ABCEstimatorSolver
label_desc: Use image node_id 17 for calling the EstimatorSolver obj's underlying member method code with example usage: obj.train_and_eval() without return types