這裏有令人驚訝的文檔或教程很少。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