【问题标题】:Installing Theano on EPD (Windows x64), g++ not detected在 EPD (Windows x64) 上安装 Theano,未检测到 g++
【发布时间】:2013-06-15 16:48:56
【问题描述】:

我正在尝试在 Windows 7 64 下的 Enthought Python Distribution(学术许可)上运行 theano。 关注主题Installing Theano on EPD (Windows x64) 我安装了theano 的前沿版本,因为我遇到了同样的错误。但是现在我遇到了这个问题:

WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU). 

EPD 安装了自己的 mingw 版本,所以我不明白为什么会出现问题。 我试图通过窗口搜索找到g++(假设EPD安装了它)放入PATH但什么也没有。

我已经单独安装了mingw64,但是当我输入命令提示符时

import theano

挂了

提前致谢。

【问题讨论】:

    标签: python-2.7 enthought win64 theano


    【解决方案1】:

    问题是我安装了 Enthought Canopy,它不包含 mingw。该问题可以通过安装 Enthought Python Distribution 来解决。在CUDA linking error - Visual Express 2008 之后,我创建了 vcvars64.bat c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\ 以避免 nvcc 致命:Visual Studio 配置文件 '(null)' 错误。 但现在我得到了这个例外:

    c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(29): error:  invalid redeclaration of type name "size_t"
    

    【讨论】:

      【解决方案2】:

      我通过在我当前的 VS2010 安装中添加 Visual C++ 编译器功能解决了这个问题。 现在我可以导入 theano 和控制台显示我使用 gpu

      >>import theano
      Forcing DISTUTILS_USE_SDK=1
      Using gpu device 0: GeForce GT 630M
      

      但是当我试图运行这段代码时:

      from theano import function, config, shared, sandbox
      import theano.tensor as T
      import numpy
      import time
      
      vlen = 10 * 30 * 768  # 10 x #cores x # threads per core
      iters = 1000
      
      rng = numpy.random.RandomState(22)
      x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
      f = function([], T.exp(x),mode='DebugMode')
      

      我明白了 NVCC: nvcc : fatal error : Could not set up the environment for Microsoft Visual Studio using 'c:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/../../VC/bin/amd64/vcvars64.bat

      【讨论】:

        【解决方案3】:

        问题不在于 Theano,而在于 nvcc。 Theano 要使用 GPU,需要安装有效的 nvcc。但目前并非如此。

        为了帮助您解决此问题,请尝试编译 nvcc 示例。他们也会失败。当你解决了这个问题后,Theano 就可以工作了。为此,请查看 nvcc 安装/测试文档。

        我怀疑你没有使用正确的微软编译器版本。 nvcc 不接受 msvc 的版本。

        【讨论】:

        • 感谢您的回答。是的,看来我使用了 win32 的编译器。现在我什至可以运行示例 Testing Theano with GPU。但是如果在运行Convolution example 时失败,我会得到这个error。我没有任何想法(
        【解决方案4】:

        尝试从 GitHub 上的 theano 存储库下载 zip,而不是使用 git 命令安装 Theano。要安装 theano,请使用 python setup.py install 命令。 也可以尝试使用 Anaconda 发行版安装 Python3.4 或更早的版本。然后使用conda install命令安装mingw以获得g++支持。

        【讨论】:

          猜你喜欢
          • 2012-05-03
          • 1970-01-01
          • 2016-11-05
          • 1970-01-01
          • 2016-08-11
          • 2016-02-14
          • 2017-04-02
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多