tensorboard使用问题解决记录

环境:Ubuntu14.04,tensorflow=1.4(bazel源码安装),Anaconda python=3.6

1. 找不到tensorboard

执行下面命令时

tensorboard --logdir=...

提示:

tensorboard: command not found

解决方法有两个:

  • (1) 编译好的tensorboard工具其路径通常为 **“anaconda3/bin/tensorboard
    ”**,可以使用全路径调用;

  • (2) 通过python命令调用tensorboard的入口函数:(该命令可以固化到环境变量中)

python anaconda3/lib/python3.6/site-packages/tensorboard/main.py --logdir=...

2. 错误:cannot import name ‘run_main’

执行下面命令时

tensorboard --logdir=...

提示:

traceback (most recent call last):
  File "anaconda3/bin/tensorboard", line 7, in <module>
    from tensorboard.main import run_main
ImportError: cannot import name 'run_main'

解决方法有两个:

  • (1)使用python命令:
python anaconda3/lib/python3.6/site-packages/tensorboard/main.py --logdir=...
  • (2)重新安装tensorboard(推荐)
pip install tb-nightly

3. 错误:port 6006 was already in use

执行下面命令时

tensorboard --logdir=...

提示:

E0117 15:58:38.631224 MainThread program.py:260] TensorBoard attempted to bind to port 6006, but it was already in use
TensorBoard attempted to bind to port 6006, but it was already in use

解决方法有两个:

  • (1)重新指定端口
tensorboard --logdir=... --port=6007
  • (2)杀掉被占用的端口(不推荐)

你可能感兴趣的:(TensorFlow)