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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/chai_zheng/article/details/81545365

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
启动模型训练过程,大功告成。
这里写图片描述

猜你喜欢

转载自blog.csdn.net/chai_zheng/article/details/81545365