TensorBoard 使用和问题解决
一、启动TensorBoard
1)
python tensorflow/tensorboard/tensorboard.py –logdir=path/to/log-directory
logdir 指向 SummaryWriter 序列化数据的存储路径。
通过在浏览器中输入 localhost:6006 来查看 TensorBoard。
2)pip安装了 TensorBoard
tensorboard –logdir=/path/to/log-directory
二、TensorBoard 问题
1)问题:ImportError: cannot import name run_main
dyufei@nodeB:~/source/test/note$ sudo tensorboard –logdir=”/home/dyufei/source/test/note/my_graph”
Traceback (most recent call last):
File “/usr/local/bin/tensorboard”, line 7, in
from tensorboard.main import run_main
ImportError: cannot import name run_main
解决重新pip安装 tensorboard
sudo pip install tensorboard
2)问题:启动在服务器上后无法远程查看
Starting TensorBoard 41 on port 6006
(You can navigate to http://127.0.1.1:6006)
解决:启动时加–host 指定ip
tensorboard –host=10.10.101.2 –logdir=”my_graph”
3)问题:端口被占用
ERROR:tensorflow:Tried to connect to port 6006, but address is in use.
Tried to connect to port 6006, but address is in use.
解决:–port 指定端口
tensorboard –host=10.10.101.2 –port=6099 –logdir=”my_graph”