TensorFlow:每次运行发现多个图事件

8

我正在加载一个TensorBoard,用于运行在本地模式下的ML引擎实验,并遇到了以下警告:

"Found more than one graph event per run, or there was a metagraph containing a graph_def, as well as one or more graph events.  Overwriting the graph with the newest event.
W0825 19:26:12.435613 Reloader event_accumulator.py:311] Found more than one metagraph event per run. Overwriting the metagraph with the newest event."

最初,我怀疑这是因为我没有清除我的--logdir=$OUTPUT_PATH(就像其他帖子建议的那样)- 但是,即使我执行了rm -rf $OUTPUT_PATH/*,我仍然在本地训练中遇到此错误。这个错误是否暗示着我图表中存在更大的问题?

1个回答

5

看来您可能已经遇到过这个帖子,但是如果没有更多信息,这就是我能提供的最佳信息:

这是已知问题,当您从不同运行中编写多个事件文件时,TensorBoard无法处理在同一目录下。如果您为每个运行使用新的子目录(新的超参数=新的子目录),则将其修复。

您可能会意外地在同一个目录中写入多个事件文件(例如,训练和评估?)。

此外,请确保在modes.EVAL模式下返回适当的tf.estimator.EstimatorSpec。从人口普查示例中:

if mode == Modes.EVAL:
  labels_one_hot = tf.one_hot(
      label_indices_vector,
      depth=label_values.shape[0],
      on_value=True,
      off_value=False,
      dtype=tf.bool
  )
  eval_metric_ops = {
      'accuracy': tf.metrics.accuracy(label_indices, predicted_indices),
      'auroc': tf.metrics.auc(labels_one_hot, probabilities)
  }
  return tf.estimator.EstimatorSpec(
      mode, loss=loss, eval_metric_ops=eval_metric_ops)

我认为这是完全可能的。我正在Modes.EVAL和Modes.TRAIN中编写标量,但Modes.EVAL中的标量从未在tensorboard中显示出来。我想我一直以为有两个事件文件(eval/event和train/event),但现在我认为事情并不那么简单。是否有一种方法可以在同一个model_fn中为train/eval编写标量,以便它们不会在同一个目录中生成多个事件文件? - reese0106
你将model_dir设置为什么(例如,run_config=tf.contrib.learn.RunConfig(model_dir=args.job_dir))?能否提供该model_dir的目录列表? - rhaertel80
更新了关于EstimatorSpec的信息。这有帮助吗? - rhaertel80
很明显我必须写多个事件文件,但我不确定这是如何发生的。我每次都用'rm -rf $JOB_DIR'删除args.job_dir,然后我仍然在开始新运行时遇到这个错误。这是model_dir的目录列表.. $ ls output checkpoint events.out.tfevents.1504204297.Users-MacBook-Pro.local graph.pbtxt model.ckpt-1.data-00000-of-00001 model.ckpt-1.index model.ckpt-1.meta 就我所知,只有单个事件文件,但tensorboard警告仍在向我喊话? - reese0106
然而,现在有另一个子目录 eval,其中包含另一个事件文件,但是警告甚至在这种情况发生之前就出现了。 - reese0106
显示剩余2条评论

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接