【问题标题】:Spyder appends Tensorboard summary filesSpyder 附加 Tensorboard 摘要文件
【发布时间】:2018-03-27 08:24:47
【问题描述】:

当我从控制台运行我的 python 代码时,一切正常:我每次都会得到一个新的 tensorboard 文件(626 字节),我可以使用 Tensorboard 服务来查找它。

但是,当我从 Spyder IDE 运行此代码时,每次运行后都会有一个新文件,其中包含自 Spyder 启动以来在 所有 中运行的数据。在 Spyder 中执行 10 次运行后,即使我关闭了 tensorboard 服务器并删除带有日志的目录,第 11 次运行后也会有一个大约 6K 大小的新文件,包含以前的所有运行。

import tensorflow as tf
a = tf.constant(2,name ='a')
b = tf.constant(3,name = 'b')
x = tf.add(a, b)
with tf.Session() as sess:
# add this line to use TensorBoard.
    writer = tf.summary.FileWriter('./graphs', sess.graph)

    print (sess.run(x))

    writer.close() # close the writer when you’re done using i

在 Spyder 重新启动后整个故事再次开始,第一次运行产生正确的结果,而第二次已经包含其前身数据。

Spyder IDE 做了一些缓存还是什么?

【问题讨论】:

    标签: python machine-learning tensorflow spyder tensorboard


    【解决方案1】:

    好的,我找到了自己问题的答案。 Spyder中有一个设置:Tools -> Preferences -> Run -> 'Clear all variables before execution'

    (也在运行 -> 每个文件的配置... -> '执行前清除所有变量')

    详情:https://github.com/spyder-ide/spyder/issues/2563

    【讨论】:

      猜你喜欢
      • 2018-12-12
      • 2018-02-26
      • 2019-02-26
      • 2017-02-24
      • 2018-05-20
      • 2016-07-01
      • 1970-01-01
      • 2019-07-26
      • 2018-12-21
      相关资源
      最近更新 更多