打开Tensorboard的具体方法【windows环境】
来源:互联网 发布:制做标志的软件 编辑:程序博客网 时间:2024/04/29 16:27
Tensorboard试了一下午都打不开.错误情况是:
connectex: Therequested address is not valid in its context.
后来得大神指点总算知道自己错在哪里,特来分享一下。
1.首先,我在E盘新建了一个文件夹名为logs。
python代码保存位置为E:\code,具体内容如下:
"""Please note, this code is only for python 3+. If you are using python 2+, please modify the code accordingly."""from __future__ import print_functionimport tensorflow as tfdef add_layer(inputs, in_size, out_size, activation_function=None): # add one more layer and return the output of this layer with tf.name_scope('layer'): with tf.name_scope('weights'): Weights = tf.Variable(tf.random_normal([in_size, out_size]), name='W') with tf.name_scope('biases'): biases = tf.Variable(tf.zeros([1, out_size]) + 0.1, name='b') with tf.name_scope('Wx_plus_b'): Wx_plus_b = tf.add(tf.matmul(inputs, Weights), biases) if activation_function is None: outputs = Wx_plus_b else: outputs = activation_function(Wx_plus_b, ) return outputs # define placeholder for inputs to networkwith tf.name_scope('inputs'): xs = tf.placeholder(tf.float32, [None, 1], name='x_input') ys = tf.placeholder(tf.float32, [None, 1], name='y_input')# add hidden layerl1 = add_layer(xs, 1, 10, activation_function=tf.nn.relu)# add output layerprediction = add_layer(l1, 10, 1, activation_function=None)# the error between prediciton and real datawith tf.name_scope('loss'): loss = tf.reduce_mean(tf.reduce_sum(tf.square(ys - prediction), reduction_indices=[1]))with tf.name_scope('train'): train_step = tf.train.GradientDescentOptimizer(0.1).minimize(loss)sess = tf.Session()# tf.train.SummaryWriter soon be deprecated, use followingif int((tf.__version__).split('.')[1]) < 12 and int((tf.__version__).split('.')[0]) < 1: # tensorflow version < 0.12 writer = tf.train.SummaryWriter('E:/logs/', sess.graph)else: # tensorflow version >= 0.12 writer = tf.summary.FileWriter("E:/logs/", sess.graph)# tf.initialize_all_variables() no long valid from# 2017-03-02 if using tensorflow >= 0.12if int((tf.__version__).split('.')[1]) < 12 and int((tf.__version__).split('.')[0]) < 1: init = tf.initialize_all_variables()else: init = tf.global_variables_initializer()sess.run(init)
2.跑一下上述代码,在文件夹E:/logs中生成日志文件。
然后打开cmd,首先进入刚才保存代码的文件夹,即E:\code.这一步至关重要,若未在此文件夹下进行后续操作,即使打开tensorboard也会出现一片空白,空白如下图。
然后打开cmd,首先进入刚才保存代码的文件夹,即E:\code.这一步至关重要,若未在此文件夹下进行后续操作,即使打开tensorboard也会出现一片空白,空白如下图。
3.在终端中输入命令
tensorboard --logdir=E:\logs
tensorboard --logdir=E:\logs
系统会给你一个网址,可是千万不要单纯的把http://0.0.0.0:6006输入自己的浏览器地址栏里,否则就会出现文章开始我说的那个错误,就是下面这样
而应该在浏览器地址栏里输入的是http://127.0.0.1:6006
其中127.0.0.1是你的localhost,具体是什么我也不知道,总之你百度一下localhost它会出现百度百科,然后告诉你是127.0.0.1.
其中127.0.0.1是你的localhost,具体是什么我也不知道,总之你百度一下localhost它会出现百度百科,然后告诉你是127.0.0.1.
最后tensorboard就打开了!图也有了!大功告成。
阅读全文
0 0
- 打开Tensorboard的具体方法【windows环境】
- Tensorboard的打开姿势
- windows 环境下Tensorboard 不能显示的解决办法
- windows 环境下Tensorboard 不能显示的解决办法
- windows下在Anaconda中使用tensorboard的方法
- Tensorboard在windows系统下的进入方法
- 【Tensorboard】Windows下tensorflow的tensorboard的使用
- Windows下tensorflow的tensorboard的使用
- TensorFlow学习笔记3——windows下采用Anaconda时使用tensorboard的方法
- Tensorboard在windows系统下的使用方法
- windows平台tensorboard的配置及使用
- Windows环境打开文件的方式总结
- 如何打开tensorboard
- 打开TensorBoard面板(MNIST)
- 远程访问服务器tensorboard的方法
- windows 环境下Tensorboard 不能显示的解决办法 No dashboards are active for the current data set
- 打开windows下某端口的方法
- Windows 10打开远程桌面的方法
- 507. Perfect Number 数学 一个数是其所有因数之和
- Linux(2)--VMware Ubuntu下载与安装
- Hive 之 Lateral View
- CCF-CSP Markdown JAVA 201703-3
- 沉浸式,透明式,可变状态栏解读
- 打开Tensorboard的具体方法【windows环境】
- 文本文件与二进制文件详解(转发)
- oracle 同义词/视图
- Android Service教案(2)
- 插入排序
- hadoop 搭建集群配置
- android启动活动(第一行代码android学习笔记)
- Tyvj1293(新姿势:次短路)
- 菜鸟--Linux下ubuntu 安装jdk、tomcat、部署web应用