VisualDL_en.md 1.9 KB
Newer Older
T
Tingquan Gao 已提交
1 2 3 4 5 6 7 8 9
# Use VisualDL to visualize the training

## Preface
VisualDL, a visualization analysis tool of PaddlePaddle, provides a variety of charts to show the trends of parameters, and visualizes model structures, data samples, histograms of tensors, PR curves , ROC curves and high-dimensional data distributions. It enables users to understand the training process and the model structure more clearly and intuitively so as to optimize models efficiently. For more information, please refer to [VisualDL](https://github.com/PaddlePaddle/VisualDL/).

## Use VisualDL in PaddleClas
Now PaddleClas support use VisualDL to visualize the changes of learning rate, loss, accuracy in training.

### Set config and start training
10
You only need to set the field `Global.use_visualdl` to `True` in train config:
T
Tingquan Gao 已提交
11 12

```yaml
13
# config.yaml
14 15 16 17
Global:
...
  use_visualdl: True
...
T
Tingquan Gao 已提交
18 19
```

20
PaddleClas will save the VisualDL logs to subdirectory `vdl/` under the output directory specified by `Global.output_dir`. And then you just need to start training normally:
T
Tingquan Gao 已提交
21 22

```shell
23
python3 tools/train.py -c config.yaml
T
Tingquan Gao 已提交
24 25 26
```

### Start VisualDL
27
After starting the training program, you can start the VisualDL service in a new terminal session:
T
Tingquan Gao 已提交
28 29

```shell
30
 visualdl --logdir ./output/vdl/
T
Tingquan Gao 已提交
31 32
```

33
In the above command, `--logdir` specify the directory of the VisualDL logs produced in training. VisualDL will traverse and iterate to find the subdirectories of the specified directory to visualize all the experimental results. You can also use the following parameters to set the IP and port number of the VisualDL service:
T
Tingquan Gao 已提交
34 35 36 37 38 39 40 41 42 43 44

* `--host`:ip, default is 127.0.0.1
* `--port`:port, default is 8040

More information about the command,please refer to [VisualDL](https://github.com/PaddlePaddle/VisualDL/blob/develop/README.md#2-launch-panel).

Then you can enter the address `127.0.0.1:8840` and view the training process in the browser:

<div align="center">
    <img src="../../images/VisualDL/train_loss.png" width="400">
</div>