我正在尝试安装 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.用pip安装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', '--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:\用户\${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-mingw32\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']\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']\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_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 -mingw32\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 不可用)
我想知道是否是 32 位 Python 与 64 位系统导致了问题。