pycharm中tensorboard调试总结
1.引言
最近做yolov5需要用到tensorboard,调试中的小问题总结记录下。没有tensorboard的自己安装。
(1).终端下激活自己环境,没有环境管理的请忽略。
conda activate 环境名
(2)直接安装
pip install tensorboard
或者:
conda install tensorboard
2.使用方法
使用前要知道日志文件是哪个?如下图
(1). 使用tensorborad前需要先找到模型运行结果,像yolov5结果保存在runs\train\exp1\2\3里面
(2). 然后在pycharm的终端运行命令(=号区别)即可:
Ubuntu中命令如下:
tensorboard --logdir=runs\train\exp1\2\3...#(日志目录)
Windows中命令如下:
tensorboard --logdir runs\train\exp1\2\3...#(日志目录)
(3). 浏览器直接输入网址http://localhost:6006/即可
3.Bugs
3.1 bug1
TensorFlow installation not found - running with reduced feature set.
解决方法:忽略,无影响
3.2 bug2
潜在Bug:浏览器打不开 http://localhost:6006/ ,请使用Google浏览器
3.3 bug3
打开网址为空:
No dashboards are active for the current data set.
Probable causes:
You haven’t written any data to your event files.
TensorBoard can’t find your event files.
问题原因:路径原因,大部分人使用目录的是相对路径,
当前目录yolovmaster,相对路径runs开始。实际上当前目录下面没有runs,它在下一层。
解决方法:
(1)相对路径法,进入下一层目录再用:
cd yolov5
tensorboard --logdir runs\train\exp1\2\3...#(日志目录)
(2)绝对路径法,直接把后面地址换为绝对路径