这里有令人惊讶的文档或教程很少。pylearn2 PATH变量
我想在我的Mac OSX 10.11.1上运行pylearn2。
Acoording到the tutorial我应该在第一此行运行:
cd pylearn/pylearn2/scripts/tutorials/grbm_smd/
python make_dataset.py
然而,脚本失败与此异常:
Traceback (most recent call last):
File "/Users/username/python/pylearn2/pylearn2/utils/string_utils.py", line 53, in preprocess
else os.environ[varname])
File "/Users/username/anaconda/lib/python3.4/os.py", line 633, in __getitem__
raise KeyError(key) from None
KeyError: 'PYLEARN2_DATA_PATH'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "make_dataset.py", line 27, in <module>
train = cifar10.CIFAR10(which_set="train")
File "/Users/username/python/pylearn2/pylearn2/datasets/cifar10.py", line 71, in __init__
string_utils.preprocess('${PYLEARN2_DATA_PATH}'),
File "/Users/username/python/pylearn2/pylearn2/utils/string_utils.py", line 56, in preprocess
reraise_as(NoDataPathError())
File "/Users/username/python/pylearn2/pylearn2/utils/exc.py", line 90, in reraise_as
six.reraise(type(new_exc), new_exc, orig_exc_traceback)
File "/Users/username/anaconda/lib/python3.4/site-packages/theano/compat/six.py", line 321, in reraise
raise value.with_traceback(tb)
File "/Users/username/python/pylearn2/pylearn2/utils/string_utils.py", line 53, in preprocess
else os.environ[varname])
File "/Users/username/anaconda/lib/python3.4/os.py", line 633, in __getitem__
raise KeyError(key) from None
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.
Mac OS X
========
Environment variables on Mac OS X work the same as in Linux, except you should
modify and run the "source" command on ~/.profile rather than ~/.bashrc.
Original exception:
KeyError: PYLEARN2_DATA_PATH
我插入从异常以下信息到〜/ .profile文件
export PYLEARN2_VIEWER_COMMAND="eog --new-instance"
and ran
source ~/.bashrc
因为它仍然抛出了一个异常,我做了一些研究,发现我必须把.profile文件放到.bash_profile文件中。所以我说这行对.bash_profile:
#.profile
source ~/.profile
但是结果还是一样:(
信息
按照installation guide说我应该添加其他信息的路径但我不明白其中的具体情况。
我系统中的隐藏文件
- .bash_history的
- 的.bash_profile
- 的.bash_profile-anaconda.bak
- .bash_sessions
- 的.config
- .ipython
- 。本地
- 的.profile
- .python_history
- .theano
- .vminfo
你说得对。我用“git clone”命令下载了它。我不知道为什么,但我真的没有。然而,它并不重要,因为pylearn2在谷歌宣布开源tensorflow后停止开发。 pylearn的原作者切换到Google的项目。 – Nex