Created: Jul 31, 2020 2:13 PM Last Edited Time: Jul 31, 2020 2:49 PM
- Enviroment
- Intall
- Basic Settings
- Logs Dir Structure
- Init Code
- Execution
- Functions
- Practice
pip install torch
pip install tensorboard
Recommend
./log_dir/timestamp
Expected Structure
./log_dir
- /202012312020
- /202012312035
- /...
We can save data through "SummaryWriter" Class
import datetime
import torch
# format : 202012311224
timestamp = datetime.datetime.today().strftime('%Y%m%d%H%M%S')
log_dir = "./log_dir/{}".format(timestamp)
# dir is generated automatically
writer = SummaryWriter(log_dir)
terminal
> tensorboard --logdir=./log_dir/
TensorBoard 2.3.0 at http://localhost:6006/ (Press CTRL+C to quit)
*Ports can be different, follow terminal's result
*No information is displayed because the model has not been trained.
https://pytorch.org/docs/stable/tensorboard.html
-
Scalar
writer.add_scalar('name', value, epoch)
-
Image
writer.add_image('name', img[][])
-
Histogram
writer.add_histogram('name', weight, epoch)
-
Graph
writer.add_graph('name', model)
https://github.com/chjinny/tensorboard_torch
terminal 1 : training
> app.py
terminal 2 : tensor board
> tensorboard --logdir=./logs/
Terminal 1
Terminal 2
Tensorboard (http://localhost:port)
-
Tensorboard
https://tutorials.pytorch.kr/intermediate/tensorboard_tutorial.html https://seongkyun.github.io/others/2019/05/11/pytorch_tensorboard/ https://pytorch.org/docs/stable/tensorboard.html https://keep-steady.tistory.com/14 https://medium.com/trackin-datalabs/tensorboard-%EA%B0%84%EB%8B%A8%ED%9E%88-%EC%8B%9C%EC%9E%91%ED%95%98%EA%B8%B0-18a4fda2efb1 https://wikidocs.net/45115
-
Markdown