我正在尝试安装Theano,这是我的情况。
系统是Windows 10(64位),CUDA 7.5与Visual Studio 2013一起安装.Python版本是Enthought Canopy(2.7.10,32位),带有pip,numpy(1.9.2-3)和scipy(0.17.0-2)。
安装如下, 1.用点子安装Theano(0.7); 2.使用enpkg工具安装mingw(4.8.1-2)和libpython(1.2); 3.将新创建的libpython27.a复制到$ {PYTHONHOME} / Libs; 4.编辑并将c:\ users \ $ {myName}下的.theanorc.txt保存为
[global]
devive=gpu
floatX=float32
[blas]
ldflags=${PYTHONHOME}\Scripts -lmk2_core -lmk2_intel_thread -lmk2_rt
[nvcc]
flags=-LC:\Users\${myName}\AppData\Local\Enthought\Canopy32\User\libs
compiler_bindir=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin
[gcc]
cxxflags=
当我尝试导入theano时,我收到以下警告和错误:
mod.cu(1019):警告:语句无法访问
mod.cu(1019):警告:语句无法访问
mod.cu 链接:致命错误LNK1181:无法打开输入文件'cublas.lib'
['nvcc',' - shared',' - O3',' - LC:\ Users \ $ {myName} \ AppData \ Local \ Enthought \ Canopy32 \ User \ libs',' - compile-bindir' ,'C:\ Program Files(x86)\ Microsoft Visual Studio 12.0 \ VC \ bin',' - Xlinker','/ DEBUG',' - D HAVE_ROUND',' - m32',' - Xcompiler',' - DCUDA_NDARRAY_CUH = 11b90075e2397c684f9dc0f7276eab8f,-D NPY_NO_DEPRECATED_API = NPY_1_7_API_VERSION,/ Zi,/ MD',' - IC:\ Users \ $ {myName} \ AppData \ Local \ Enthought \ Canopy32 \ User \ lib \ site-packages \ theano \ sandbox \ cuda' ,'-IC:\ Users \ $ {myName} \ AppData \ Local \ Enthought \ Canopy32 \ App \ appdata \ canopy-1.6.2.3262.win-x86 \ lib \ site-packages \ numpy \ core \ include',' - IC:\ Users \ $ {myName} \ AppData \ Local \ Enthought \ Canopy32 \ App \ appdata \ canopy-1.6.2.3262.win-x86 \ include',' - o','C:\ Users \ $ {myName} \ AppData \ Local \ Theano \ compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_71_Stepping_1_GenuineIntel-2.7.10-32 \ cuda_ndarray \ cuda_ndarray.pyd','mod.cu',' - LC:\ Users \ $ {myName} \ AppData \本地\ Enthought \ Canopy32 \ User \ EGG-INFO \ mingw \ usr \ x86_64-w64-mingw32 \ lib',' - LC:\ Users \ $ {myName} \ AppData \ Loc al \ Enthought \ Canopy32 \ App \ appdata \ canopy-1.6.2.3262.win-x86 \ libs',' - LC:\ Users \ $ {myName} \ AppData \ Local \ Enthought \ Canopy32 \ App \ appdata \ canopy-1.6 .2.3262.win-x86',' - lpython27',' - plublas',' - lcudart']
错误(theano.sandbox.cuda):无法编译cuda_ndarray.cu :('nvcc return status',2,'for cmd','nvcc -shared -O3 -LC:\ Users \ $ {myName} \ AppData \ Local \ Enthought \ Canopy32 \ User \ libs --compiler-bindir C:\ Program Files(x86)\ Microsoft Visual Studio 12.0 \ VC \ bin -Xlinker / DEBUG -D HAVE_ROUND -m32 -Xcompiler -DCUDA_NDARRAY_CUH = 11b90075e2397c684f9dc0f7276eab8f, - D NPY_NO_DEPRECATED_API = NPY_1_7_API_VERSION,/ Zi,/ MD -IC:\ Users \ $ {myName} \ AppData \ Local \ Enthought \ Canopy32 \ User \ lib \ site-packages \ theano \ sandbox \ cuda -IC:\ Users \ $ { myName} \ AppData \ Local \ Enthought \ Canopy32 \ App \ appdata \ canopy-1.6.2.3262.win-x86 \ lib \ site-packages \ numpy \ core \ include -IC:\ Users \ $ {myName} \ AppData \ Local \ Enthought \ Canopy32 \ App \ appdata \ canopy-1.6.2.3262.win-x86 \ include -o C:\ Users \ $ {myName} \ AppData \ Local \ Theano \ compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_71_Stepping_1_GenuineIntel-2.7。 10-32 \ cuda_ndarray \ cuda_ndarray.pyd mod.cu -LC:\ Users \ $ {myName} \ AppData \ Local \ Enthought \ Canopy32 \ User \ EGG-INFO \ mingw \ usr \ x86_64-w64-m ingw32 \ lib -LC:\ Users \ $ {myName} \ AppData \ Local \ Enthought \ Canopy32 \ App \ appdata \ canopy-1.6.2.3262.win-x86 \ libs -LC:\ Users \ $ {myName} \ AppData \ Local \ Enthought \ Canopy32 \ App \ appdata \ canopy-1.6.2.3262.win-x86 -lpython27 -lcublas -lcudart')
警告(theano.sandbox.cuda):已安装CUDA,但设备gpu不可用(错误:cuda unavilable)
我想知道是否是导致此问题的32位Python与64位系统。
答案 0 :(得分:0)
正如@Robert在评论中指出的那样,警告提示兼容性问题。我终于通过安装64位Enthought Canopy python发行版解决了这个问题,其他步骤与问题中描述的相同。
值得一提的是,Mingw也可以由Enthough Canopy包管理器安装,因此如果您使用的是分发版,则无需下载独立的mingw。