import tensorflow as tf

      hooks.append(tf.data.experimental.CheckpointInputPipelineHook(estimator))

    train_spec = tf.estimator.TrainSpec(input_fn=train_input_fn, max_steps=FLAGS.num_train_steps, hooks=hooks)
    eval_spec = tf.estimator.EvalSpec(input_fn=eval_input_fn, steps=FLAGS.max_eval_steps)
    tf.estimator.train_and_evaluate(estimator, train_spec, eval_spec)

