message: Update monitors.py
  * Update monitors.py
  Replace deprecated SummaryWriter and SummaryWriterCache with FileWriter and FileWriterCache
  * Update monitors.py
  Move away from contrib to train
  * Update monitors.py
  Reorder import statements according to PEP8
diff: @@ -50,9 +50,10 @@ from tensorflow.core.util.event_pb2 import SessionLog
  from tensorflow.python.estimator import estimator as core_estimator
  from tensorflow.python.framework import ops
  from tensorflow.python.platform import tf_logging as logging
  +from tensorflow.python.summary import summary as core_summary
  from tensorflow.python.training import saver as saver_lib
  from tensorflow.python.training import session_run_hook
  -from tensorflow.python.training import summary_io
  +from tensorflow.python.training import training_util
  from tensorflow.python.util import deprecation
  from tensorflow.python.util import tf_inspect
  @@ -521,7 +522,7 @@ class SummarySaver(EveryN):
  self._summary_op = summary_op
  self._summary_writer = summary_writer
  if summary_writer is None and output_dir:
  - self._summary_writer = summary_io.SummaryWriter(output_dir)
  + self._summary_writer = core_summary.FileWriter(output_dir)
  self._scaffold = scaffold
  # TODO(mdan): Throw an error if output_dir and summary_writer are None.
  @@ -529,7 +530,7 @@ class SummarySaver(EveryN):
  super(SummarySaver, self).set_estimator(estimator)
  # TODO(mdan): This line looks redundant.
  if self._summary_writer is None:
  - self._summary_writer = summary_io.SummaryWriter(estimator.model_dir)
  + self._summary_writer = core_summary.FileWriter(estimator.model_dir)
  def every_n_step_begin(self, step):
  super(SummarySaver, self).every_n_step_begin(step)
  @@ -1029,7 +1030,7 @@ class CheckpointSaver(BaseMonitor):
  logging.info("Create CheckpointSaver.")
  super(CheckpointSaver, self).__init__()
  self._saver = saver
  - self._summary_writer = SummaryWriterCache.get(checkpoint_dir)
  + self._summary_writer = core_summary.FileWriterCache.get(checkpoint_dir)
  self._save_path = os.path.join(checkpoint_dir, checkpoint_basename)
  self._scaffold = scaffold
  self._save_secs = save_secs
  @@ -1098,12 +1099,12 @@ class StepCounter(EveryN):
  self._last_reported_time = None
  self._summary_writer = summary_writer
  if summary_writer is None and output_dir:
  - self._summary_writer = SummaryWriterCache.get(output_dir)
  + self._summary_writer = core_summary.FileWriterCache.get(output_dir)
  def set_estimator(self, estimator):
  super(StepCounter, self).set_estimator(estimator)
  if self._summary_writer is None:
  - self._summary_writer = SummaryWriterCache.get(estimator.model_dir)
  + self._summary_writer = core_summary.FileWriterCache.get(estimator.model_dir)
  def every_n_step_end(self, current_step, outputs):
  current_time = time.time()
  @@ -1169,7 +1170,7 @@ class RunHookAdapterForMonitors(session_run_hook.SessionRunHook):
  def begin(self):
  self._last_step = None
  - self._global_step_tensor = contrib_variables.get_global_step()
  + self._global_step_tensor = training_util.get_global_step()
  for m in self._monitors:
  m.begin(max_steps=None)
  