千家信息网

Pytorch中使用tensorboard的方法

发表于:2024-09-22 作者:千家信息网编辑
千家信息网最后更新 2024年09月22日,这篇文章主要讲解了"Pytorch中使用tensorboard的方法",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"Pytorch中使用tensorbo
千家信息网最后更新 2024年09月22日Pytorch中使用tensorboard的方法

这篇文章主要讲解了"Pytorch中使用tensorboard的方法",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"Pytorch中使用tensorboard的方法"吧!

代码:

from torch.utils.tensorboard import SummaryWriterimport torchvertices_tensor = torch.as_tensor([[1, 1, 1],[-1, -1, 1],[1, -1, -1],[-1, 1, -1],], dtype=torch.float).unsqueeze(0)colors_tensor = torch.as_tensor([[255, 0, 0],[0, 255, 0],[0, 0, 255],[255, 0, 255],], dtype=torch.int).unsqueeze(0)faces_tensor = torch.as_tensor([[0, 2, 3],[0, 3, 1],[0, 1, 2],[1, 3, 2],], dtype=torch.int).unsqueeze(0)writer = SummaryWriter()writer.add_mesh('my_mesh', vertices=vertices_tensor, colors=colors_tensor, faces=faces_tensor)writer.close()# tensorboard --logdir=runs

运行效果展示:

感谢各位的阅读,以上就是"Pytorch中使用tensorboard的方法"的内容了,经过本文的学习后,相信大家对Pytorch中使用tensorboard的方法这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是,小编将为大家推送更多相关知识点的文章,欢迎关注!

0