pytorch-tensorboardX

from tensorboardX import SummaryWriter
import torchvision.utils as vutils

writer = SummaryWriter()

for i, (x, y) in enumerate(dataloader):

    xxx

    writer.add_scalar('/train/loss', loss)
    writer.add_scalar('/train/acc', acc)

    writer.add_image('train/inputs', utils.make_grid(x.cpu().data, normalize=True), gloabal_step= xx)

    writer.add_text('text', ll, global_step=xx)

writer.close()

reference

  1. https://github.com/lanpa/tensorboard-pytorch

你可能感兴趣的:(PyTorch)