【问题标题】:TensorBoard error - [WinError 2] The system cannot find the file specifiedTensorBoard 错误 - [WinError 2] 系统找不到指定的文件
【发布时间】:2019-03-22 11:23:52
【问题描述】:

我正在尝试使用以下代码运行 TensorBoard

%load_ ext tensorboard.notebook

import tensorflow as tf

x = tf.constant( [100,200,300], name = 'x')
y = tf.constant([1,2,3], name = 'y')

sum_x = tf.reduce_sum(x, name="sum_x"
prod y = tf.reduce_prod(y,name="prod_y")

final div = tf.div(sum_x, prod_y, name = 'final div’)
final_mean = tf.reduce_mean([sum_x, prod_y], name = 'final_mean*)
sess=tf .Session()

print ("x: ",sess.run(x))
print ("y: ", sess.run(y))
print ("sum(x): ", sess.run(sum_x))
print ("prod(y): ", sess.run(prod_y))
print ("sum(x)/prod(y): ", sess.run(final_ div))
print ("mean(sum(x), prod(y)): ", sess.run(final_mean))

writer = tf.summary.FileWriter('janani_ex_2', sess.graph)
writer.close()

sess.close()

%tensorboard --logdir = 'janani_ex_2'

这会显示Launching tensorboard,然后遇到[WinError 2] The system cannot find the file specified error

我做错了什么?

【问题讨论】:

  • 你能把代码和错误贴在这里吗?

标签: python tensorflow tensorboard


【解决方案1】:

在 Windows 上,您需要更改此行

%tensorboard --logdir = 'janani_ex_2'

%tensorboard --logdir '.\janani_ex_2'

我假设文件夹 janani_ex_2 包含您的日志,并且它位于您的 jupyter 笔记本所在的文件夹内。

【讨论】:

    【解决方案2】:

    如果您使用 Jupyter 笔记本,则在包含 tensorboard 对象的文件夹中,使用以下命令:

    tensorboard --logdir ./
    

    它将在当前文件夹中查找文件。要进入该文件夹,请键入 cd,然后复制并粘贴该文件夹的名称。

    【讨论】:

      猜你喜欢
      • 2021-07-14
      • 2017-08-01
      • 2019-07-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多