因为想安装Theano到系里的电脑上,但是本人并没有root权限,无奈在google group之theano-user上发帖问大神[注1有对话 : ) ]。
Sigurd的回答非常有帮助的,顺着这个线索我最后安装成功了。
系统版本:Cent OS 6.x
原始安装参考:http://deeplearning.net/software/theano/install_centos6.html#install-centos6
- 1. $ sudo yum install python-devel python-nose python-setuptools gcc gcc-gfortran gcc-c++ blas-devel lapack-devel atlas-devel
- 2. $ sudo easy_install pip
- 3. $ sudo pip install numpy==1.6.1
- 4. $ sudo pip install scipy==0.10.1
- 5. $ sudo pip install Theano
但我之前说了没root权限,没法用sudo!!!
系里的机子默认已经安装了gcc, gfortran等。
所以,第一步安装 Blas, Lapack, Atlas, 不能用sodu,意味着也无法yum了。不过我们可以用yumdownloader:
1. 用yumdownloader所需的rpm
- $ yumdownloader blas-devel lapack-devel atlas-devel
- $ rpm2cpio *rpm | cpio -id
- $ mv usr ~/usr
- export BLAS=~/usr/lib64/libblas.a
- export LAPACK=~/usr/lib64/liblapack.a
- export ATLAS=~/usr/lib64/atlas/libatlas.a
2. 用easy_install --user安装pip
在这之前,先设置环境变量PYTHONUSERBASE
- export PYTHONUSERBASE=~/PYTHON
- export PATH=$PATH:~/PYTHON/bin
- $ easy_install --user pip
3. 用pip install --user安装numpy
- $ pip install --user numpy==1.6.1
- $ pip install --user scipy==0.10.1
5. 用pip install --user安装Thean
- $ pip install --user Theano
安装完成后,测试了下4个不同机器上GPU的性能.
- $ python theano/misc/check_blas.py
测试结果:
- $ cat gpu0* | grep "Total exe"
- Total execution time: 0.45s on GPU. [GeForce GTX 285]
- Total execution time: 0.25s on GPU. [Tesla C2075]
- Total execution time: 0.19s on GPU. [GeForce GTX 480]
- Total execution time: 0.45s on GPU. [GeForce GTX 285]
注:安装过程中出现错误要先解读错误,可能根据错误提示简单改一下就行了。
注1:
-------------------------------------------------------------------------------------------------------------------------------------------
Hi Eric,
You can install python packages underneath your home directory. For installing Theano with pip or from source, just add --user.
pip install --user Theanopython setup.py install --user
Also see http://docs.python.org/2/install/#alternate-installation for more details.
Sigurd
Am Montag, 15. Juli 2013 10:23:17 UTC+2 schrieb Eric:Hi,I tried to install theano in the clusters at our lab.But, unfortunately, I am just a user rather than root user. I cannot use "sudo".Any idea for installing theano without root authority is appreciated.
Besides, I may ask administrators to install theano for me. However, sometimes, it also requires root authority when running a theano/pylearn2 program. How to avoid it ? Many thanks.
-- Eric