Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

The method of using tensorboard to add matplotlib in Pytorch

Shulou Source: shulou.com Published: 2022-06-02 06:29:57 10月02日 Update

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!

Tags: Methods learning content code that is ideas situations articles more knowledge knowledge points articles results follow problems pockmarked practice push research run Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Shulou Technology Huawei Xiaomi OPPO Reno