tensorflow - 使用tf.Estimator时如何控制丢失日志消息的频率

标签 tensorflow tensorflow-estimator

我正在使用TF 1.4。
我的问题是关于tf.estimator.Estimator。

我想控制“损失和步伐”信息消息的出现频率,例如:

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

我正在将tf.estimator.RunConfig传递给Estimator的构造函数。但我认为没有参数可以控制“损失和损失”消息。

我认为参数是在estimator.py中的_train_model方法中硬编码的:
      worker_hooks.extend([
      training.NanTensorHook(estimator_spec.loss),
      training.LoggingTensorHook(
          {
              'loss': estimator_spec.loss,
              'step': global_step_tensor
          },
          every_n_iter=100)
  ])

最佳答案

tensorflow v1.8支持log_step_count_steps:https://www.tensorflow.org/api_docs/python/tf/estimator/RunConfig

关于tensorflow - 使用tf.Estimator时如何控制丢失日志消息的频率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47499368/

相关文章:

python-3.x - Tensorflow 错误 "UnimplementedError: Cast string to float is not supported"- 使用估计器的线性分类器模型

python - Tensorflow:tf.name_scope不带 'with'

python - 使用 tf.estimator.WarmStartSettings 加载(或组合)多个预训练检查点

tensorflow - 使用 tf.control_dependencies 的相同代码的不同结果

opencv - 我们是否可以在浏览器上离线实现人脸检测和识别?

python - 在 tensorflow 中使用保存的估计器时出现 saving_model_cli 问题

python - Tensorflow Estimator : loss not decreasing when using tf. feature_column.embedding_column 用于分类变量列表

python - 使用 Tensorflow-2.0 tf.optimizers 时如何修复 'The given object is not an Optimizer instance'?

tensorflow - MirroredStrategy不使用GPU

tensorflow - 使用 Vanilla Numpy 进行 LSTM 计算