tensorflow笔记--tensorboard出错:Found more than one metagraph event per run

  在命令行中启动 tensorboard 后,会报如下错误:

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.  Overwri
ting the graph with the newest event.
Found more than one metagraph event per run. Overwriting the metagraph with the newest event.

  出现错误原因:由于多次运行程序,之前的logs一直保留着,新的logs只是续写,没有覆盖,所以tensorflow报出提醒,你点开tensorboard后会发现你的loss图有些奇怪。
  解决办法:在你训练之前,可以将文件中的内容删除,代码如下:

import tensorflow as tf

logdir = './logs/'
if tf.gfile.Exists(logdir):
    tf.gfile.DeleteRecursively(logdir)
发布了27 篇原创文章 · 获赞 10 · 访问量 5007

猜你喜欢

转载自blog.csdn.net/l1l1l1l/article/details/103241065