Visdom: '>' not supported between instances of 'float' and 'NoneType'

Created on 19 Aug 2018  路  9Comments  路  Source: fossasia/visdom

Bug Description
I recently did a general upgrade to python 3.7 and latest visdom, and several console output issues appeared.

The worst culprit is the following showing in output every few seconds:

'>' not supported between instances of 'float' and 'NoneType'

This issue does not show up in commit ec91e738e100a9cbf946c332c7783ffd12c644b5 but is present in commit 17f28cb258ad874d6fc5fcce5a4479abe4377738

To be clear: everything functions correctly, but when training in pytorch, output info is drowned out by the error:

'>' not supported between instances of 'float' and 'NoneType'                                                          鈹侷NFO:root:Opened visdom socket from ip: ::1
'>' not supported between instances of 'float' and 'NoneType'                                                          鈹侷NFO:tornado.access:101 GET /vis_socket (::1) 0.64ms
'>' not supported between instances of 'float' and 'NoneType'                                                          鈹侷NFO:root:Opened visdom socket from ip: ::1
'>' not supported between instances of 'float' and 'NoneType'                                                          鈹侷NFO:tornado.access:200 POST /win_exists (::1) 0.69ms
basic1 epoch: 62 loss: 2772.736160993576                                                                               鈹侷NFO:tornado.access:200 POST /update (::1) 0.59ms
'>' not supported between instances of 'float' and 'NoneType'                                                          鈹侷NFO:tornado.access:101 GET /vis_socket (::1) 0.53ms
'>' not supported between instances of 'float' and 'NoneType'                                                          鈹侷NFO:root:Opened visdom socket from ip: ::1

Reproduction Steps
I have reproduced the error on two separate machines, one using anaconda with python 3.7 on ubuntu 16.04, another using system python 3.7 on arch linux. I have tried visdom from pip, and master. Both show the same issue.

Python 3.7.0 (default, Jul 15 2018, 10:44:58) 
[GCC 8.1.1 20180531] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import visdom
>>> vis = visdom.Visdom()
'>' not supported between instances of 'float' and 'NoneType'
'>' not supported between instances of 'float' and 'NoneType'
'>' not supported between instances of 'float' and 'NoneType'
Visdom python client failed to establish socket to get messages from the server. This feature is optional and can be disabled by initializing Visdom with `use_incoming_socket=False`, which will prevent waiting for this request to timeout.
>>> '>' not supported between instances of 'float' and 'NoneType'
'>' not supported between instances of 'float' and 'NoneType'
'>' not supported between instances of 'float' and 'NoneType'
'>' not supported between instances of 'float' and 'NoneType'
'>' not supported between instances of 'float' and 'NoneType'
'>' not supported between instances of 'float' and 'NoneType'
'>' not supported between instances of 'float' and 'NoneType'

Expected behavior
I would expect the messages not to appear.

Server logs:
Each time the > message appears in console, a GET /vis_socket request happens. The deprecation notice is also present on both machines, although I don't think that's relevant here.

$ python -m visdom.server
visdom/py/visdom/server.py:30: DeprecationWarning: zmq.eventloop.ioloop is deprecated in pyzmq 17. pyzmq now works with default tornado and asyncio eventloops.
  ioloop.install()  # Needs to happen before any tornado imports!
Downloading scripts. It might take a while.
It's Alive!
INFO:root:Application Started
You can navigate to http://localhost:8097
INFO:tornado.access:200 POST /env/main (::1) 0.92ms
INFO:tornado.access:101 GET /vis_socket (::1) 0.51ms
INFO:root:Opened visdom socket from ip: ::1
INFO:tornado.access:101 GET /vis_socket (::1) 0.74ms
INFO:root:Opened visdom socket from ip: ::1
INFO:tornado.access:101 GET /vis_socket (::1) 0.69ms
INFO:root:Opened visdom socket from ip: ::1
INFO:tornado.access:101 GET /vis_socket (::1) 0.70ms
INFO:root:Opened visdom socket from ip: ::1
INFO:tornado.access:101 GET /vis_socket (::1) 0.71ms
INFO:root:Opened visdom socket from ip: ::1
INFO:tornado.access:101 GET /vis_socket (::1) 0.97ms
INFO:root:Opened visdom socket from ip: ::1

Additional context
Everything is standard, happens with basic vanilla install on python 3.7.

bug

Most helpful comment

I see this happening in visdom 0.1.8.5 but not in visdom 0.1.8.4.

Edit: just read about logging.

All 9 comments

Confirm the same behaviour on python 3.5, however not on python2.7.
Minimal code to reproduce:

python3 -m visdom.server &
python3 -c "import visdom; vis = visdom.Visdom(); print(vis.check_connection())"

the output is similar

unorderable types: float() > NoneType()
unorderable types: float() > NoneType()
unorderable types: float() > NoneType()
Visdom python client failed to establish socket to get messages from the server. This feature is optional and can be disabled by initializing Visdom with `use_incoming_socket=False`, which will prevent waiting for this request to timeout.
False

Hi @dkumor - I'll need to investigate what's causing this issue. The bug has _existed_ for long before 1.8.5 but in 1.8.5 I started logging it rather than keeping it silent. I don't see anything in the socket initialization code that would be initiating a > operation, so it could be somewhat involved (I'm also not able to reproduce on my machine for some reason). In the meantime you should be able to avoid the issue using vis = visdom.Visdom(use_incoming_socket=False).

I see this happening in visdom 0.1.8.5 but not in visdom 0.1.8.4.

Edit: just read about logging.

Upstream bug in websocket-client is here:
https://github.com/websocket-client/websocket-client/issues/466

As mentioned there, passing ping_timeout=100.0 (amount is arbitrary) to ws.run_forever fixes the problem.

Ah thanks for drilling down to the source here @xqms!

Any ideas about why

"unorderable types: float() > NoneType()
unorderable types: float() > NoneType()
unorderable types: float() > NoneType()
Visdom python client failed to establish socket to get messages from the server. This feature is optional and can be disabled by initializing Visdom with use_incoming_socket=False, which will prevent waiting for this request to timeout."

this bug occurs?

I am facing the same bug when I use visdom with python3 "0.1.8.5" and when I set "use_incoming_socket= False" nothing will be displayed on visdom page

It's currently being caused by a bug in one of visdom's dependancies. You can either download an earlier version of websocket-client or install visdom from source until https://github.com/websocket-client/websocket-client/issues/466 is fixed.

Edit: I opened a PR in their repo with a fix, hopefully they pull it soon.

Is this problem fixed? I have this problems for 5 days. Still didn't figure it out. I may downgrade earlier version of websocket client?

You can fix it by updating the dependency where this is coming from: I fixed this in websocket-client

Was this page helpful?
0 / 5 - 0 ratings

Related issues

skrish13 picture skrish13  路  4Comments

shubhamjain0594 picture shubhamjain0594  路  3Comments

ebagdasa picture ebagdasa  路  5Comments

pedropgusmao picture pedropgusmao  路  3Comments

malmaud picture malmaud  路  3Comments