Pytorch中使用tensorboard学习笔记(3) 创建SummaryWriter对象

参考链接: torch.utils.tensorboard.writer.SummaryWriter

使用方式

torch.utils.tensorboard.writer.SummaryWriter(
	log_dir=None, 
	comment='', 
	purge_step=None, 
	max_queue=10, 
	flush_secs=120, 
	filename_suffix='')
from torch.utils.tensorboard import SummaryWriter

# create a summary writer with automatically generated folder name.
writer = SummaryWriter()
# folder location: runs\Dec10_22-22-11_chenxuqi-desktop

# create a summary writer using the specified folder name.
writer = SummaryWriter("my_experiment")
# folder location: my_experiment

# create a summary writer with comment appended.
writer = SummaryWriter(comment="LR_0.1_BATCH_16")
# folder location: runs\Dec10_22-22-14_chenxuqi-desktopLR_0.1_BATCH_16

运行结果:
Pytorch中使用tensorboard学习笔记(3) 创建SummaryWriter对象_第1张图片

你可能感兴趣的:(Pytorch中使用tensorboard学习笔记(3) 创建SummaryWriter对象)