PaddleClas/docs/zh_CN/others/VisualDL.md

44 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 使用VisualDL可视化训练过程
## 前言
VisualDL是飞桨可视化分析工具以丰富的图表呈现训练参数变化趋势、模型结构、数据样本、高维数据分布等。可帮助用户更清晰直观地理解深度学习模型训练过程及模型结构进而实现高效的模型优化。更多细节请查看[VisualDL](https://github.com/PaddlePaddle/VisualDL/)。
## 在PaddleClas中使用VisualDL
现在PaddleClas支持在训练阶段使用VisualDL查看训练过程中学习率learning rate、损失值loss以及准确率accuracy的变化情况。
### 设置config文件并启动训练
在PaddleClas中使用VisualDL只需在训练配置文件config文件中设置字段 `Global.use_visualdl``True`
```yaml
# config.yaml
Global:
...
use_visualdl: True
...
```
PaddleClas 会将 VisualDL 的日志保存在 `Global.output_dir` 字段指定目录下的 `vdl/` 子目录下,然后正常启动训练即可:
```shell
python3 tools/train.py -c config.yaml
```
### 启动VisualDL
在启动训练程序后可以在新的终端session中启动VisualDL服务
```shell
visualdl --logdir ./output/vdl/
```
上述命令中,参数`--logdir`用于指定保存 VisualDL 日志的目录VisualDL将遍历并且迭代寻找指定目录的子目录将所有实验结果进行可视化。也同样可以使用下述参数设定VisualDL服务的ip及端口号
* `--host`设定IP默认为127.0.0.1
* `--port`设定端口默认为8040
更多参数信息,请查看[VisualDL](https://github.com/PaddlePaddle/VisualDL/blob/develop/README_CN.md#2-%E5%90%AF%E5%8A%A8%E9%9D%A2%E6%9D%BF)。
在启动VisualDL后即可在浏览器中查看训练过程输入地址`127.0.0.1:8840`
<div align="center">
<img src="../../images/VisualDL/train_loss.png" width="400">
</div>