valenook.ua
valenook.ua

Reputation: 13

Python. h2o.demo cause exception on jupyter

H2O Python demo does not work on jupyter notebook and show exception because these demos are setting key press event.

(press any key)    demo_function(interactive, echo, test)
  File "/home/administrator/venv/lib/python3.5/site-packages/h2o/demos.py", line 135, in deeplearning
    _run_demo(demo_body, interactive, echo, testing)
  File "/home/administrator/venv/lib/python3.5/site-packages/h2o/demos.py", line 285, in _run_demo
    body_fn(controller)
  File "/home/administrator/venv/lib/python3.5/site-packages/h2o/demos.py", line 92, in demo_body
    go()
  File "/home/administrator/venv/lib/python3.5/site-packages/h2o/demos.py", line 273, in controller
    key = _wait_for_keypress()
  File "/home/administrator/venv/lib/python3.5/site-packages/h2o/demos.py", line 312, in _wait_for_keypress
    oldterm = termios.tcgetattr(fd)
termios.error: (25, 'Inappropriate ioctl for device')

How to resolve this problem? My code:

import h2o
h2o.init()
h2o.demo('glm')

Upvotes: 1

Views: 881

Answers (1)

Darren Cook
Darren Cook

Reputation: 28913

Use ipython from the commandline, for h2o.demo().

If you want to stick with Juypter notebooks, there are a whole bunch of demos in that form here: https://github.com/h2oai/h2o-3/tree/master/h2o-py/demos

Upvotes: 2

Related Questions