From dcd0acba5eb53d8df02716e44b8ef440e862e96e Mon Sep 17 00:00:00 2001 From: shippingwang Date: Tue, 2 Jun 2020 12:59:30 +0000 Subject: [PATCH] add visualdl doc --- docs/zh_CN/tutorials/getting_started.md | 10 +++++++++- ppcls/utils/logger.py | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/zh_CN/tutorials/getting_started.md b/docs/zh_CN/tutorials/getting_started.md index 11bea841..8790faf9 100644 --- a/docs/zh_CN/tutorials/getting_started.md +++ b/docs/zh_CN/tutorials/getting_started.md @@ -41,7 +41,8 @@ python -m paddle.distributed.launch \ --selected_gpus="0,1,2,3" \ tools/train.py \ -c ./configs/ResNet/ResNet50_vd.yaml \ - -o use_mix=1 + -o use_mix=1 \ + --vdl_dir=./scalar/ ``` @@ -53,6 +54,13 @@ epoch:0 train step:522 loss:1.6330 lr:0.100000 elapse:0.210 也可以直接修改模型对应的配置文件更新配置。具体配置参数参考[配置文档](config.md)。 +训练期间可以通过VisualDL实时观察loss变化,启动命令如下: + +```bash +visualdl --logdir ./scalar --host --port + +``` + ### 2.2 模型微调 diff --git a/ppcls/utils/logger.py b/ppcls/utils/logger.py index 7dda65e6..12789c7c 100644 --- a/ppcls/utils/logger.py +++ b/ppcls/utils/logger.py @@ -82,6 +82,13 @@ def error(fmt, *args): def scaler(name, value, step, writer): + """ + This function will draw a scalar curve generated by the visualdl. + Usage: Install visualdl: pip3 install visualdl==2.0.0b4 + and then: + visualdl --logdir ./scalar --host 0.0.0.0 --port 8830 + to preview loss corve in real time. + """ writer.add_scalar(name, value, step) -- GitLab