PyTorch可视化工具Visdom不显示toolbar和窗口解决方法

ぐ巨炮叔叔 提交于 2019-12-07 21:25:02

Visdom是Facebook在2017年发布的一款针对PyTorch的可视化工具,在本地PC上很好用。当迁移到内网服务器上时,我发现对于某些作图功能无法正常显示,甚至直接连toolbar都消失了。找遍全网,发现四个中文相关的问题,
https://www.cnblogs.com/yuanzhoulvpi/p/9244186.html
https://blog.csdn.net/qq_22194315/article/details/78827185
https://blog.csdn.net/AnthongDai/article/details/79117472
http://tieba.baidu.com/p/5397000061
均无法解决。遂追至官方github的issue部分,找到了症结所在,一般内网服务器很少配备VPN条件,所以Visdom无法下载某些作图组件,GFW的问题。

总结解法如下:
下载以下两个文件,放至 /home/amax/anaconda3/lib/python3.6/site-packages/visdom/static/js下。
1, plotly.js-master: https://github.com/plotly/plotly.js
2, react-gird-layout-master: https://github.com/STRML/react-grid-layout

修改.static.index.html中的索引为:

    <!-- Other deps -->
    <script src={{ static_url("js/react-react.min.js") }}></script>
    <script src={{ static_url("js/react-dom.min.js") }}></script>
    <script src={{ static_url("fonts/layout_bin_packer") }}></script>
    <script src={{ static_url("js/react-grid-layout-master/dist/react-grid-layout.min.js") }}></script>

    <!-- Mathjax -->
    <script type="text/javascript" async src={{ static_url("js/mathjax-MathJax.js") }}></script>

    <!-- Plotly -->
    <script src={{ static_url("js/plotly.js-master/dist/plotly.min.js") }}></script>

随后,启动visdom
python -m visdom.server
启动模型训练过程,大功告成。
这里写图片描述

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!