Michael Rubinstein
Michael Rubinstein

Reputation: 91

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

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)
  ])

Upvotes: 9

Views: 2909

Answers (2)

Lucien Wang
Lucien Wang

Reputation: 61

log_step_count_steps is supported in tensorflow v1.8: https://www.tensorflow.org/api_docs/python/tf/estimator/RunConfig

Upvotes: 6

Related Questions