Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)
  ])
like image 369
Michael Rubinstein Avatar asked Nov 26 '17 18:11

Michael Rubinstein


1 Answers

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

like image 174
Lucien Wang Avatar answered Nov 13 '22 15:11

Lucien Wang