【发布时间】: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