获得;pygpu已配置,但无法导入;尝试使用OpenCL+时出错;AMD Radeon上的Theano

获得;pygpu已配置,但无法导入;尝试使用OpenCL+时出错;AMD Radeon上的Theano,opencl,theano,amd,Opencl,Theano,Amd,我已按照以下说明进行操作: 但是当我尝试时:THEANO_FLAGS=device=opencl0:0python test.py 在测试文件上,我遇到错误: 错误(theano.sandbox.gpuarray):pygpu已配置,但无法导入 回溯(最近一次呼叫最后一次): 文件“/home/mesayantn/.local/lib/python2.7/site packages/theano/sandbox/gpuarray/init.py”,第20行,在 import pygpu 文件

我已按照以下说明进行操作:

但是当我尝试时:THEANO_FLAGS=device=opencl0:0python test.py
在测试文件上,我遇到错误:

错误(theano.sandbox.gpuarray):pygpu已配置,但无法导入 回溯(最近一次呼叫最后一次): 文件“/home/mesayantn/.local/lib/python2.7/site packages/theano/sandbox/gpuarray/init.py”,第20行,在

import pygpu
文件“/usr/src/gtest/clBLAS/build/libgpuarray/pygpu/init.py”,第7行,在

from . import gpuarray, elemwise, reduction
文件“/usr/src/gtest/clBLAS/build/libgpuarray/pygpu/elemwise.py”,第3行,在

from .dtypes import dtype_to_ctype, get_common_dtype
文件“/usr/src/gtest/clBLAS/build/libgpuarray/pygpu/dtypes.py”,第6行,在

from . import gpuarray
ImportError:无法导入名称gpuarray


我没有好主意。我是第一次使用这些。我正在开发Ubuntu 14.04 LTS。如何解决此错误?

我通过Lippuarray网站中提供的逐步安装解决了此问题

下载

git clone https://github.com/Theano/libgpuarray.git
cd libgpuarray
安装
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 ..
资料来源:

这对我有用!
祝您好运

安装
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
然后呢

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
关于python3的构建和安装

python3 setup.py build
sudo -H python3 setup.py install

我希望它能帮助你。现在,我只缺少开发版本的
theano

如果在cmake期间指定前缀,则行
python setup.py build
会略有不同。该链接在此上下文中提供了正确的行。
python3 setup.py build
sudo -H python3 setup.py install