5,321
edits
No edit summary |
|||
Line 21: | Line 21: | ||
See [https://pytorch.org/docs/stable/tensorboard.html https://pytorch.org/docs/stable/tensorboard.html]. | See [https://pytorch.org/docs/stable/tensorboard.html https://pytorch.org/docs/stable/tensorboard.html]. | ||
There is also [https://github.com/lanpa/tensorboardX lanpa/tensorboardX] but I haven't tried it. | There is also [https://github.com/lanpa/tensorboardX lanpa/tensorboardX] but I haven't tried it. | ||
<syntaxhighlight lang="python"> | |||
from torch.utils.tensorboard import SummaryWriter | |||
writer = SummaryWriter(log_dir="./runs") | |||
writer.add_scalar("train_loss", loss_np, step) | |||
# Optionally flush e.g. at checkpoints | |||
writer.flush() | |||
# Close the writer (will flush) | |||
writer.close() | |||
</syntaxhighlight> | |||
==Resources== | ==Resources== | ||
* [https://www.tensorflow.org/tensorboard/get_started Getting started with TensorBoard] | * [https://www.tensorflow.org/tensorboard/get_started Getting started with TensorBoard] | ||
* [https://www.youtube.com/watch?v=eBbEDRsCmv4 Hands-on TensorBoard (TensorFlow Dev Summit 2017)] | * [https://www.youtube.com/watch?v=eBbEDRsCmv4 Hands-on TensorBoard (TensorFlow Dev Summit 2017)] |