|
| 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 | + |
0 commit comments