pytorch:tensorboardX可视化,本地显示

参考链接:
https://github.com/lanpa/tensorboardX
https://blog.csdn.net/xiepengyue666/article/details/80236082

 #服务器上调用tensorboard,参考tensorboardX官方提供的demo.py
from tensorboardX import SummaryWriter
writer = SummaryWriter()
...
writer.add_scalar
writer.add_audio
writer.add_image
writer.add_text
writer.add_graph
writer.add_embedding

#首先使用ssh登陆服务器并转发端口
ssh -L 6006:127.0.0.1:6006 [email protected]
(ssh -L 本地端口:本地IP:远程端口 远程服务器用户名@远程服务器Ip)

#在服务器上运行tensorboard
tensorboard --logdir=./runs

#在本机地址运行
http://127.0.0.1:6006

你可能感兴趣的:(pytorch)