Install Theano in Linux without root authority (sodu)

来源:互联网 发布:阿里云短信发送java 编辑:程序博客网 时间:2024/04/29 09:40

因为想安装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-devel2. $ sudo easy_install pip3. $ sudo pip install numpy==1.6.14. $ sudo pip install scipy==0.10.15. $ 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:

$ rpm2cpio *rpm | cpio -id
copy到$HOME或你想的目录下

$ mv usr ~/usr
然后要设置环境变量,修改~/.bashrc,设置下Blas, Lapack, Atlas的路径

export BLAS=~/usr/lib64/libblas.aexport LAPACK=~/usr/lib64/liblapack.aexport ATLAS=~/usr/lib64/atlas/libatlas.a
这样就完成了第一步. 

2. 用easy_install --user安装pip

在这之前,先设置环境变量PYTHONUSERBASE

export PYTHONUSERBASE=~/PYTHONexport PATH=$PATH:~/PYTHON/bin

$ easy_install --user pip

3. 用pip install --user安装numpy

$ pip install --user numpy==1.6.1
4. 用pip install --user安装scipy

$ 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:

-------------------------------------------------------------------------------------------------------------------------------------------

On Monday, July 15, 2013 4:32:47 PM UTC+8, Sigurd wrote:
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 Theano
python 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 
-------------------------------------------------------------------------------------------------------------------------------------------


原创粉丝点击