The method of using tensorboard to add matplotlib in Pytorch
This article mainly explains "the method of using tensorboard to add matplotlib in Pytorch". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the method of using tensorboard to add matplotlib in Pytorch".
Code:
From torch.utils.tensorboard import SummaryWriter# plots scatter diagram import numpy as npimport matplotlib.pyplot as pltnp.random.seed (20200910) fig, ax = plt.subplots () ax.plot (10*np.random.randn, 10*np.random.randn,'o') ax.set_title ('Simple Scatter') # plt.show () writer = SummaryWriter () writer.add_figure (' matplotlib figure Lin Zuquan', fig, global_step=None, close=False, walltime=None) # tensorboard-- logdir=runs
Show the running results:
Thank you for your reading, the above is the content of "using tensorboard to add matplotlib in Pytorch". After the study of this article, I believe you have a deeper understanding of the problem of using tensorboard to add matplotlib in Pytorch, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!