Reputation: 91
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
Reputation: 61
log_step_count_steps
is supported in tensorflow v1.8: https://www.tensorflow.org/api_docs/python/tf/estimator/RunConfig
Upvotes: 6
Reputation: 2140
try returning the logging_hook as training_hook param in returned estimator_spec for mode == 'train' Printing extra training metrics with Tensorflow Estimator
https://github.com/tensorflow/tensorflow/pull/619/commits/48603b7faed85753ab905f177cbf4e0c8d1dcb64
https://www.tensorflow.org/install/install_sources#clone_the_tensorflow_repository
src: https://stackoverflow.com/a/38097276/2218905
Upvotes: 0