Skip to content

Commit 03b8080

Browse files
authored
add doc for tensorboard (tusen-ai#221)
1 parent 5b8e899 commit 03b8080

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

doc/TENSORBOARD.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
## Introduction
2+
3+
### Setup tensorboard
4+
```bash
5+
pip3 install mxboard tensorboard --user
6+
```
7+
8+
### Modify your config
9+
You need to import the `SummaryWriter` and pass it to your metric in the config.
10+
11+
```python
12+
from mxboard import SummaryWriter
13+
14+
# modify the logdir as you like
15+
sw = SummaryWriter(logdir="./tflogs", flush_secs=5)
16+
17+
rpn_acc_metric = metric.AccWithIgnore(
18+
name="RpnAcc",
19+
output_names=["rpn_cls_loss_output", "rpn_cls_label_blockgrad_output"],
20+
label_names=[],
21+
summary=sw
22+
)
23+
rpn_l1_metric = metric.L1(
24+
name="RpnL1",
25+
output_names=["rpn_reg_loss_output", "rpn_cls_label_blockgrad_output"],
26+
label_names=[],
27+
summary=sw
28+
)
29+
box_acc_metric = metric.AccWithIgnore(
30+
name="RcnnAcc",
31+
output_names=["bbox_cls_loss_output", "bbox_label_blockgrad_output"],
32+
label_names=[],
33+
summary=sw
34+
)
35+
box_l1_metric = metric.L1(
36+
name="RcnnL1",
37+
output_names=["bbox_reg_loss_output", "bbox_label_blockgrad_output"],
38+
label_names=[],
39+
summary=sw
40+
)
41+
mask_cls_metric = SigmoidCELossMetric(
42+
name="MaskCE",
43+
output_names=["mask_loss_output"],
44+
label_names=[],
45+
summary=sw
46+
)
47+
```
48+
49+
50+
### Launch tensorborad on the shell
51+
```bash
52+
# you can specify the logdir in your
53+
tensorboard --logdir tflogs > /dev/null 2>&1 &
54+
55+
python detection_train --config path/to/your/config.py
56+
```
57+
58+
Now open the web browser you can see the training curve like
59+
![training_curve](image/tensorboard_screenshot.png)
59.2 KB
Loading

0 commit comments

Comments
 (0)