How to control frequency of loss logging messages when using tf.Estimator

Viewed 2803

I'm using TF 1.4. My question is about tf.estimator.Estimator.

I'd like to control the frequency of the "loss and step" Info messages, like:

INFO:tensorflow:loss = 0.00896569, step = 14901 (14.937 sec)

I'm passing a tf.estimator.RunConfig to the Estimator's constructor. But I don't think there is a parameter to control the "loss and step" messages.

I think the parameter is hard-coded in estimator.py, in the _train_model method:

      worker_hooks.extend([
      training.NanTensorHook(estimator_spec.loss),
      training.LoggingTensorHook(
          {
              'loss': estimator_spec.loss,
              'step': global_step_tensor
          },
          every_n_iter=100)
  ])
2 Answers
Related