lisa-lab/pylearn2

failed on the quick start example

Closed this issue · 1 comments

ubgpu@ubgpu:~/github/pylearn2/pylearn2/scripts/tutorials/grbm_smd$ sudo python make_dataset.py
Using gpu device 0: GeForce GTX 970
Traceback (most recent call last):
File "make_dataset.py", line 27, in
train = cifar10.CIFAR10(which_set="train")
File "/home/ubgpu/github/pylearn2/pylearn2/datasets/cifar10.py", line 71, in init
string_utils.preprocess('${PYLEARN2_DATA_PATH}'),
File "/home/ubgpu/github/pylearn2/pylearn2/utils/string_utils.py", line 56, in preprocess
reraise_as(NoDataPathError())
File "/home/ubgpu/github/pylearn2/pylearn2/utils/exc.py", line 90, in reraise_as
six.reraise(type(new_exc), new_exc, orig_exc_traceback)
File "/home/ubgpu/github/pylearn2/pylearn2/utils/string_utils.py", line 53, in preprocess
else os.environ[varname])
File "/usr/lib/python2.7/UserDict.py", line 23, in getitem
raise KeyError(key)
pylearn2.utils.exc.NoDataPathError: You need to define your PYLEARN2_DATA_PATH environment variable. If you are
using a computer at LISA, this should be set to /data/lisa/data.

Platform-specific instructions for setting environment variables:

Linux

On most linux setups, you can define your environment variable by adding this
line to your ~/.bashrc file:

export PYLEARN2_VIEWER_COMMAND="eog --new-instance"

*** YOU MUST INCLUDE THE WORD "export". DO NOT JUST ASSIGN TO THE ENVIRONMENT VARIABLE ***
If you do not include the word "export", the environment variable will be set
in your bash shell, but will not be visible to processes that you launch from
it, like the python interpreter.

Don't forget that changes from your .bashrc file won't apply until you run

source ~/.bashrc

or open a new terminal window. If you're seeing this from an ipython notebook
you'll need to restart the ipython notebook, or maybe modify os.environ from
an ipython cell.

.......

I am sure the env is OK:

ubgpu@ubgpu:/github/pylearn2/pylearn2/scripts/tutorials/grbm_smd$ echo $PYLEARN2_DATA_PATH
/home/ubgpu/big_data/PYLEARN2_DATA
ubgpu@ubgpu:
/github/pylearn2/pylearn2/scripts/tutorials/grbm_smd$ echo $PYLEARN2_VIEWER_COMMAND
eog --new-instance
ubgpu@ubgpu:~/github/pylearn2/pylearn2/scripts/tutorials/grbm_smd$

If you use sudo, it will use the environment for the root user, not the one for your user.
You should probably note use sudo for that.