本文介绍了获取“pygpu 已配置但无法导入";在 AMD Radeon 上尝试使用 OpenCL+Theano 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已按照此说明进行操作:

I have followed the instructions from this:

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

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

But then when I tried : THEANO_FLAGS=device=opencl0:0 python test.py
on the test file I am getting error:

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

ERROR (theano.sandbox.gpuarray): pygpu was configured but could not be importedTraceback (most recent call last): File "/home/mesayantan/.local/lib/python2.7/site-packages/theano/sandbox/gpuarray/init.py", line 20, in

import pygpu

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

File "/usr/src/gtest/clBLAS/build/libgpuarray/pygpu/init.py", line 7, in

from . import gpuarray, elemwise, reduction

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

File "/usr/src/gtest/clBLAS/build/libgpuarray/pygpu/elemwise.py", line 3, in

from .dtypes import dtype_to_ctype, get_common_dtype

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

File "/usr/src/gtest/clBLAS/build/libgpuarray/pygpu/dtypes.py", line 6, in

from . import gpuarray

导入错误:无法导入名称 gpuarray

ImportError: cannot import name gpuarray

我没有什么好主意.我第一次使用所有这些.我正在 Ubuntu 14.04 LTS 上工作.我该如何解决这个错误?

I do not have good idea. I am using all these for the first time. I am working on Ubuntu 14.04 LTS. How can I resolve this error?

推荐答案

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

I fixed this issue with the step-by-step installation given in the lipgpuarray website!

下载

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 ..

安装pygpu

# This must be done after libgpuarray is installed as per instructions above.
python setup.py build
python setup.py install

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

这对我有用!祝你好运

这篇关于获取“pygpu 已配置但无法导入";在 AMD Radeon 上尝试使用 OpenCL+Theano 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-13 09:45