pycuda 失败;Theano 与 Anaconda [英] pycuda fail; Theano with Anaconda

查看:26
本文介绍了pycuda 失败;Theano 与 Anaconda的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Anaconda 在 MacOSX(Mavericks 10.9)上安装 Theano,就像这篇文章解释的那样:如何让 Theano 在 Mac Lion 上运行?"

I'm using Anaconda to install Theano on MacOSX (Mavericks 10.9 ), just like this post explains: "How to make Theano operate on Mac Lion?"

theano.test()

theano.test()

此命令给出与上面帖子中相同的错误.它在 Ubuntu 14.1 和 System 76 上也会出现该错误.

This command gives the same error as in the post above. It gives that error on an Ubuntu 14.1, System 76 as well.

我可以从 Theano 导入命令;但我仍然想了解为什么 theano.test() 失败.CUDA 和 Boost 软件包在运行之前已经安装...

(参考:请参阅部分:测试您的安装"http://deeplearning.net/software/theano/install.html)

(Reference: See section: "Testing your Installation" http://deeplearning.net/software/theano/install.html)

正如帖子所暗示的,我认为修复将来自安装 XCode 命令行、自制软件和 pycuda.前两个安装得很好.但是 pycuda 失败了:

As the post suggests, I assumed the fix would come from installing the XCode command line, homebrew, and pycuda. The first two were installed just fine. But pycuda fails:

pip 安装 pycuda

pip install pycuda

....给出以下错误:

....gives the following error:

    > src/cpp/cuda.cpp -o build/temp.macosx-10.5-x86_64-3.4/src/cpp/cuda.o
    >     In file included from src/cpp/cuda.cpp:1:

> 
>     src/cpp/cuda.hpp:14:10: fatal error: 'cuda.h' file not found
>     #include <cuda.h>

>              ^
>     1 error generated.
>     error: command 'gcc' failed with exit status 1
>  


    >    Command "//anaconda/bin/python3 -c "import setuptools,

    >tokenize;__file__='/private/var/folders/5b/5g1stsns34x_7mgynxhhvf1h0000gn/T/pip-build-4raihcb4/pycuda/setup.py';exec(compile(getattr(tokenize,
    > 'open', open)(__file__).read().replace('\r\n', '\n'), __file__,
    > 'exec'))" install --record
    > /var/folders/5b/5g1stsns34x_7mgynxhhvf1h0000gn/T/pip-kr_3ws22-record/install-record.txt



    >> --single-version-externally-managed --compile" failed with error code 1 in

    > /private/var/folders/5b/5g1stsns34x_7mgynxhhvf1h0000gn/T/pip-build-4raihcb4/pycuda

似乎第一个错误(gcc failed)是编译器没有找到 gcc.(再次注意:我安装了 MacOSX 命令行工具)

It seems like the first error (gcc failed) is that the complier is not finding gcc. (Note again: I installed the MacOSX command line tools)

我跑

which gcc 

这给了 usr/bin/gcc

this gives usr/bin/gcc

我也试过:

python configure.py --cuda-root=/usr/local/cuda
--cuda-inc-dir=/Developer/NVIDIA/CUDA-5.5/include --cudart-lib-dir=/Developer/NVIDIA/CUDA-5.5/lib

那也没有用.

有没有其他人在安装 pycuda 时遇到过这种困难,可以在这里提出建议吗?谢谢.

Has anyone else had this difficulty installing pycuda and can make a recommendation here? Thanks.

推荐答案

第一个错误不是说明 gcc 没有找到,而是说明 gcc报了一个错误,那个错误是找不到文件cuda.h.

The first error is not indicating that gcc failed to be found, rather it is saying that gcc reported an error and that error was that the file cuda.h could not be found.

该错误表明您没有安装 CUDA 工具包.在继续安装 PyCUDA 之前,您需要安装它.CUDA 工具包可以从 NVIDIA 网站下载.

That error suggests you don't have the CUDA toolkit installed. You need to install this before proceeding to install PyCUDA. The CUDA toolkit can be downloaded from NVIDIA's website.

PyCUDA 网页表明它具有以下先决条件:BOOST、CUDA 和麻木.

The PyCUDA web page indicates that it has the following prerequisites: BOOST, CUDA, and Numpy.

这篇关于pycuda 失败;Theano 与 Anaconda的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆