TensorBoard初探
平台及安装环境
-
平台:Macbook pro(Retina),Sierra 10.12.5。
-
安装Anaconda python3.7版本 https://www.anaconda.com/download/#macos
-
利用Anaconda安装Tensorflow
https://www.tensorflow.org/install/install_mac?hl=zh-cn#installing_with_anaconda
这里安装Python 3.7 环境中安装仅支持 CPU 的 TensorFlow 版本:
https://download.tensorflow.google.cn/mac/cpu/tensorflow-1.8.0-py3-none-any.whl -
此后发现,上述Tensorflow携带python为3.7版本,为满足Tensorflow1.8需求将python改为3.6版本,并重新安装Tensorflow。
- 安装python3.6: conda install python=3.6
- 安装tensorflow环境: conda create -n tensorflow pip python=3.6
- 激活环境: source activate tensorflow
- 更新pip环境:pip install --upgrade pip
- 安装tensorflow:pip install --ignore-installed --upgrade https://download.tensorflow.google.cn/mac/cpu/tensorflow-1.8.0-py3-none-any.whl
参考链接:
https://blog.csdn.net/karmacode/article/details/79602800
使用Tensorboard
- 进入到log目录下
cd /tmp/tensorflow_logs/example - 当前log目录下仅有一条log。
rm -rf * - 执行包含tensorboard summary的代码
- 设置好host和端口:
tensorboard --logdir=./ --host=127.0.0.1 --port=8080 - 在浏览器上输入地址: http://127.0.0.1:8080,查看tensorboard