Theano/Lasagne/nolearn配置过程错误汇总

错误汇总

1.运行时错误

Error:ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: libcublas.so.7.5: cannot open shared object file:
原因:cuda动态库未载入
解决方法:
sudo ldconfig /usr/local/cuda/lib64
or
1)sudo gedit ld.so.conf
2)加入 /usr/local/cuda/lib64(根据自己安装的路径)
3)ldconfig

2.nolearn install error

matplot :the following required packages can not be built * freetype png
原因:freetype png属于系统包pip不会自动安装
解决方法
1)sudo apt-get install libfreetype6-dev
2)sudo apt-get install libpng12-dev

3.运行kfkd例子时报错

ValueError: (‘The following error happened while compiling the node’, GpuCAReduce{add}{1}(

4.GPU不可用,动态库找不到

原因:动态库未正确加载
解决方法:
1)su
2)sudo echo “/usr/local/cuda-7.5/lib64” > /etc/ld.so.conf.d/cuda.conf
3)sudo ldconfig

5.gcc版本错误

unsupported GNU version! gcc versions later than 4.9 are not supported!
原因:ubuntu升级之后,gcc版本太高
解决方法
sudo ln -s /usr/bin/gcc-4.7 /usr/local/cuda-7.5/bin/gcc

6. numpy.test error

typeError: can’t convert complex to float
原因:用的是anaconda2的numpy包,版本太高或者不兼容
解决方法
利用系统自带的python安装numpy,sudo gedit .bashrc 将anaconda2添加的系统环境先注销

CUDA Toolkit安装过程

各版本CUDA下载链接:CUDA
1)sudo dpkg -i cuda7.5.deb
2)sudo apt-get update
3)sudo apt-get install cuda

CUDA Toolkit环境配置

1)sudo gedit /etc/environment
2)加入 LD_LIBRARY_PATH=”/usr/local/cuda/lib64”
or
1) sudo ~/.theanorc
2)加入
[cuda]
root = /usr/local/cuda

VirtualEnv的使用

virtualenv –system-site-packages -p python2.7 theano-env

1)system-site-packages表示载入系统已有的python包如(numpy,scipy等)
2)-p python2.7制定python版本
3)theano-env虚拟环境的目录名,可自定义

source theano-env/bin/activate
运行source,进入虚拟环境

你可能感兴趣的:(virtualenv,Theano配置错误,CUDA安装过程,Theano错误汇总)