【解决方案】tensorboard---'tensorboard' 不是内部或外部命令,也不是可运行的程序

1 确认你已经将python/scripts添加至环境变量中 确认你已经安装好tensorflow

PS:如何安装tensorflow?

在python/Scripts目录下输入cmd进入命令行窗口

输入pip install tensorflow

等待几分钟后安装完成

然后测试tensorflow:

如果没有报错证明已经安装成功。

2将文件路径写到tensorboard.exe的路径中去,也就是Python/Scripts中(附带测试代码)

import tensorflow as tf
with tf.name_scope('score'):
	score = tf.Variable(36.0, name= "score")
	#用来显示标量信息
	tf.summary.scalar('score-e',score)
with tf.name_scope('factor'):
	factor = tf.Variable(10.0, name= "factor")
	tf.summary.scalar('factor-e',factor)
with tf.name_scope('sqart'):
	temp = tf.sqrt(score)
	tf.summary.scalar('temp-e',temp)
with tf.name_scope('new_score'):
	new_score = tf.multiply(factor, temp)
	tf.summary.scalar('new_score',new_score)
sess = tf.Session()
init = tf.global_variables_initializer()  
sess.run(init)
result = sess.run(new_score)
summary_op = tf.summary.merge_all()
#文件路径为你的tensorboard.exe所在路径
writer = tf.summary.FileWriter("E:/python35/Scripts/logs_test/", sess.graph)
print(result)
sess.close() 

执行上述代码,发现在python/scripts路径下生成了logs_test文件

3在Python/Scripts目录下输入cmd进入命令行窗口

输入tensorboard --logdir=E:/python35/Scripts/logs_test/

4复制命令行中的网址,打开Chrome浏览器,粘贴,回车

大功告成。

  • 0
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值