在AMD Radeon上尝试使用OpenCL + Theano时,获取"pygpu已配置但无法导入"错误

Say*_*osh 9 amd opencl theano

我遵循了以下说明:

https://gist.github.com/jarutis/ff28bca8cfb9ce0c8b1a

但是当我尝试时:
测试文件中的THEANO_FLAGS = device = opencl0:0 python test.py 我收到错误:

错误(theano.sandbox.gpuarray):pygpu已配置但无法导入Traceback(最近一次调用最后一次):文件"/home/mesayantan/.local/lib/python2.7/site-packages/theano/sandbox/gpuarray/init .py",第20行,in

import pygpu
Run Code Online (Sandbox Code Playgroud)

文件"/ usr/src/gtest/clBLAS/build/libgpuarray/pygpu/init .py",第7行,in

from . import gpuarray, elemwise, reduction
Run Code Online (Sandbox Code Playgroud)

文件"/usr/src/gtest/clBLAS/build/libgpuarray/pygpu/elemwise.py",第3行,in

from .dtypes import dtype_to_ctype, get_common_dtype
Run Code Online (Sandbox Code Playgroud)

文件"/usr/src/gtest/clBLAS/build/libgpuarray/pygpu/dtypes.py",第6行,in

from . import gpuarray
Run Code Online (Sandbox Code Playgroud)

ImportError:无法导入名称gpuarray

我没有好主意.我是第一次使用这些.我正在研究Ubuntu 14.04 LTS.我该如何解决这个错误?

小智 9

我通过lipgpuarray网站上给出的逐步安装解决了这个问题!

下载

git clone https://github.com/Theano/libgpuarray.git
cd libgpuarray
Run Code Online (Sandbox Code Playgroud)

安装 libgpuarray

# extract or clone the source to <dir>
cd <dir> 
mkdir Build
cd Build
# you can pass -DCMAKE_INSTALL_PREFIX=/path/to/somewhere to install to an alternate location
cmake .. -DCMAKE_BUILD_TYPE=Release # or Debug if you are investigating a crash
make
make install
cd ..
Run Code Online (Sandbox Code Playgroud)

安装 pygpu

# This must be done after libgpuarray is installed as per instructions above.
python setup.py build
python setup.py install
Run Code Online (Sandbox Code Playgroud)

资料来源:http: //deeplearning.net/software/libgpuarray/installation.html

这对我有用!祝好运


Mih*_*Zam 5

安装blas库似乎就足够了。我正在针对同样的问题进行测试。

cd ~
git clone https://github.com/clMathLibraries/clBLAS.git
cd clBLAS/
mkdir build
cd build/
sudo apt-cache search openblas
sudo apt-get install libopenblas-base libopenblas-dev
sudo apt-get install liblapack3gf liblapack-doc liblapack-dev
cmake ../src
make
sudo make install
Run Code Online (Sandbox Code Playgroud)

在那之后

git clone https://github.com/Theano/libgpuarray.git
cd libgpuarray
mkdir Build
cd Build
cmake .. -DCMAKE_BUILD_TYPE=Release

make
sudo make install
cd ..
sudo apt-get install cython
sudo apt-get install python-numpy python-scipy python-dev python-pip python-nose g++ libopenblas-dev git
Run Code Online (Sandbox Code Playgroud)

建造和安装有关python3

python3 setup.py build
sudo -H python3 setup.py install
Run Code Online (Sandbox Code Playgroud)

我希望它可以帮助你。theano现在我只缺少开发版本。