{{ message }}

# Fix Tutorial Notebooks to Not Shell out Python #1034

Open
opened this issue Jul 18, 2014 · 7 comments
Open

# Fix Tutorial Notebooks to Not Shell out Python#1034

opened this issue Jul 18, 2014 · 7 comments

### cancan101 commented Jul 18, 2014

 Calls like: !show_weights.py convolutional_network_best.pkl Have problems when running on a remote IPython Notebook server as they do not render the images inline and instead give messages like this: pylearn2.utils.exc.EnvironmentVariableError: PYLEARN2_VIEWER_COMMAND not defined. PLEASE READ THE FOLLOWING MESSAGE CAREFULLY TO SET UP THIS ENVIRONMENT VARIABLE: pylearn2 uses an external program to display images. Because different systems have different image programs available, pylearn2 requires the user to specify what image viewer program to use. You need to choose an image viewer program that pylearn2 should use. Then tell pylearn2 to use that image viewer program by defining your PYLEARN2_VIEWER_COMMAND environment variable. You need to choose PYLEARN_VIEWER_COMMAND such that running  they also seem unnatural/ not clean. Why not import that module and call into it rather than using the command line parser, etc?

### dwf commented Jul 19, 2014

 I agree, this has been on my mind for a while. Ideally we should just make the patch viewer object expose the appropriate IPython display hooks and have a top-level function that instantiates it easily. On Jul 18, 2014 7:20 PM, "Alex Rothberg" notifications@github.com wrote: Calls like: !show_weights.py convolutional_network_best.pkl Have problems when running on a remote IPython Notebook server as they do not render the images inline and instead give messages like this: pylearn2.utils.exc.EnvironmentVariableError: PYLEARN2_VIEWER_COMMAND not defined. PLEASE READ THE FOLLOWING MESSAGE CAREFULLY TO SET UP THIS ENVIRONMENT VARIABLE: pylearn2 uses an external program to display images. Because different systems have different image programs available, pylearn2 requires the user to specify what image viewer program to use. You need to choose an image viewer program that pylearn2 should use. Then tell pylearn2 to use that image viewer program by defining your PYLEARN2_VIEWER_COMMAND environment variable. You need to choose PYLEARN_VIEWER_COMMAND such that running they also seem unnatural/ not clean. Why not import that module and call into it rather than using the command line parser, etc? — Reply to this email directly or view it on GitHub #1034.

### cancan101 commented Jul 21, 2014

 These are the changes that I made to get plot_monitor to work embedded in a Notebook: https://github.com/cancan101/pylearn2/compare/ipython_embed_script

### cancan101 commented Jul 23, 2014

 @dwf I actually think that a pretty simple change will catch many of these: cancan101@16e33da
closed this Jul 24, 2014
reopened this Jul 24, 2014

### goodfeli commented Jul 30, 2014

 I would just recommend not using ipython notebooks anymore. They get math rendering errors on most browsers if you write more than 20 lines or so of math.

### cancan101 commented Jul 30, 2014

 Is that a mathjax bug or an ipython notebook bug? Also, abandoning Ipython Notebooks because of some math rendering issues seems a bit extreme.

### goodfeli commented Jul 30, 2014

 The math rendering was the only interesting reason to use them in this context, and it's basically broken. They are more annoying to run remotely, harder to do code review on because they don't line wrap sensibly, and have all sorts of browser performance issues.

### madisonmay commented Jul 30, 2014

 I'm also not a fan of ipython notebooks for pylearn2 -- with the huge monitor outputs generated by running train.py on certain yaml files, ipython notebooks can sometimes take minutes to load on my machine. The multilayer_perceptron tutorial is particularly slow to load because of this.
mentioned this issue Nov 11, 2014