我正尝试在Windows7 64下的license发行版(学术许可证)上运行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). 环保署安装了自己版本的mingw,所以我不明白为何会出现这个问题。我试着通过窗口搜索找到g++ (假设是环保署安装的)放入PATH,但什么也没有。
我已经单独安装了mingw64,但当我在命令提示符中键入时
import theano它挂起来了
提前谢谢。
发布于 2013-06-16 19:38:29
问题是我安装了,但它没有包含mingw。这个问题可以通过安装Enthought发行版来解决。遵循CUDA linking error - Visual Express 2008,我在c:\Program Files (x86)\Microsoft Visual Studio10.0\VC\bin\amd64\中创建了vcvars64.bat,以避免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"发布于 2013-06-16 23:24:25
我在当前的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
发布于 2013-06-17 22:06:55
问题不在于Theano,而在于nvcc。Theano要使用GPU,需要安装nvcc。但目前情况并非如此。
为了帮助您解决此问题,请尝试编译nvcc示例。他们也会失败。当你解决了这个问题,Theano就可以工作了。为此,请查看nvcc安装/测试文档。
我怀疑您没有使用正确的microsoft编译器版本。nvcc不接受msvc版本。
https://stackoverflow.com/questions/17125845
复制相似问题