visdom无法正常使用

前言

visdom是一个可视化工具,一个灵活的工具,用于创建,组织和共享实时丰富数据的可视化。支持Torch和Numpy。
更过介绍或者官方github

问题描述

首先安装好visdom:

$ pip install visdom
$ python -m visdom.server

终端提示如下,但是等了好长时间也没有结束:

Downloading scripts. It might take a while.

这个问题可能是我们无法访问部分国外网站导致的,所以找到 lib/python2.7/sitepackages/visdom/server.py 将download_scripts()注释掉,然后重新启动服务:

$ python -m visdom.server
It's Alive!
INFO:root:Application Started
You can navigate to http://localhost:8097

用浏览器打开该地址
发现一片空白,同时终端有如下提示:

ERROR:tornado.general:Could not open static file u/lib/python2.7/site-packages/visdom/static/fonts/layout_bin_packer'
INFO:tornado.access:200 GET / (127.0.0.1) 9.72ms
WARNING:tornado.access:404 GET /static/fonts/layout_bin_packer (127.0.0.1) 1.68ms
INFO:tornado.access:200 GET /static/js/plotly-plotly.min.js?v=adc89fbc14625411fd1e109c93c59372 (127.0.0.1) 4.91ms
INFO:tornado.access:200 GET /favicon.png (127.0.0.1) 2.64ms
WARNING:tornado.access:404 GET /static/fonts/layout_bin_packer (127.0.0.1) 1.01ms
INFO:tornado.access:101 GET /socket (127.0.0.1) 0.92ms
INFO:root:Opened new socket from ip: 127.0.0.1
INFO:tornado.access:200 POST /env/main (127.0.0.1) 0.59ms

找到 lib/python2.7/sitepackages/visdom/static 中的index.html,将其用如下index.html替换:

  <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="shortcut icon" href="favicon.png">  <link href="https://unpkg.com/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"> <script src="https://unpkg.com/[email protected]/dist/jquery.min.js">script> <script src="https://unpkg.com/[email protected]/dist/js/bootstrap.min.js">script> <link rel="stylesheet" href="https://unpkg.com/[email protected]/css/styles.css"> <link rel="stylesheet" href="https://unpkg.com/[email protected]/css/styles.css">  <script src="https://unpkg.com/react@15/dist/react.min.js">script> <script src="https://unpkg.com/react-dom@15/dist/react-dom.min.js">script> <script src="https://unpkg.com/[email protected]">script> <script src="https://unpkg.com/[email protected]">script>  <script src="http://pytorch-1252820389.cosbj.myqcloud.com/visdom/react-grid-layout.min.js">script>  <script type="text/javascript" async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_SVG">script>   <script src="https://cdn.plot.ly/plotly-latest.min.js">script>  <script> // TODO: this is not great. Should probably be an endpoint with a JSON // response or the first thing the socket sends back. var ENV_LIST = [ {% for item in items %} '{{escape(item)}}', {% end %} ]; var ACTIVE_ENV = '{{escape(active_item)}}'; var USER = '{{escape(user)}}'; // Plotly setup window.PLOTLYENV = window.PLOTLYENV || {}; window.PLOTLYENV.BASE_URL = 'https://plot.ly'; script> <script src={{ static_url("js/main.js") }}>script> <link rel="stylesheet" href={{ static_url("css/style.css") }}> <title>visdomtitle>  head> <body> <noscript>JS is requirednoscript> <div id="app">div> body> html>

visualDL

百度最新发布的可视化工具,虽然有bug,但是用着还可以,比较简单。
https://github.com/PaddlePaddle/VisualDL

你可能感兴趣的:(visdom无法正常使用)