我是theano的新手。 按照本指南操作后:http://deeplearning.net/software/theano/install_windows.html#install-windows我成功地与theano合作。后来我升级到theano开发版,现在我一直得到这个例外:
import theano
........... cuda_ndarray.cu printed out........
===============================
nvcc : fatal error : redefinition of argument 'cl-version'
['nvcc', '-shared', '-O3', '--cl-version=2010', '--cl-version=2010', '-Xlinker', '/DEBUG', '-D HAVE_ROUND', '-m64', '-Xc
ompiler', '--use-local,-DCUDA_NDARRAY_CUH=18715462c72ed6afcd7ca5d52813ce90,-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-
-use-local,/Zi,/MD', '-IC:\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\lib\\site-packages\\theano\\sandbox\\cuda', '
-IC:\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\lib\\site-packages\\numpy\\core\\include', '-IC:\\WinPython-64bit-2
.7.10.3\\python-2.7.10.amd64\\include', '-IC:\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\lib\\site-packages\\theano
\\gof', '-o', 'C:\\Users\\Kostya\\AppData\\Local\\Theano\\compiledir_Windows-7-6.1.7600-Intel64_Family_6_Model_42_Steppi
ng_7_GenuineIntel-2.7.10-64\\cuda_ndarray\\cuda_ndarray.pyd', 'mod.cu', '-LC:\\WinPython-64bit-2.7.10.3\\python-2.7.10.a
md64\\libs', '-LC:\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64', '-lpython27', '-lcublas', '-lcudart']
ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: ('nvcc return status', -1, 'for cmd', 'nvcc -shared -O3
--cl-version=2010 --cl-version=2010 -Xlinker /DEBUG -D HAVE_ROUND -m64 -Xcompiler --use-local,-DCUDA_NDARRAY_CUH=1871546
2c72ed6afcd7ca5d52813ce90,-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,--use-local,/Zi,/MD -IC:\\WinPython-64bit-2.7.10.3
\\python-2.7.10.amd64\\lib\\site-packages\\theano\\sandbox\\cuda -IC:\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\li
b\\site-packages\\numpy\\core\\include -IC:\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\include -IC:\\WinPython-64bi
t-2.7.10.3\\python-2.7.10.amd64\\lib\\site-packages\\theano\\gof -o C:\\Users\\Kostya\\AppData\\Local\\Theano\\compiledi
r_Windows-7-6.1.7600-Intel64_Family_6_Model_42_Stepping_7_GenuineIntel-2.7.10-64\\cuda_ndarray\\cuda_ndarray.pyd mod.cu
-LC:\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\libs -LC:\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64 -lpython27
-lcublas -lcudart')
WARNING (theano.sandbox.cuda): CUDA is installed, but device gpu is not available (error: cuda unavailable)
.theanorc文件:
[global]
device = gpu
floatX = float32
#optimizer = fast_run
[nvcc]
flags = --cl-version=2010 --use-local
#fastmath = True
#[blas]
#ldflags = -lf77blas -latlas -lgfortran
#[cuda]
root=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5
nvcc.profile:
TOP = $(_HERE_)/..
NVVMIR_LIBRARY_DIR = $(TOP)/nvvm/libdevice
PATH += $(TOP)/open64/bin;$(TOP)/nvvm/bin;$(_HERE_);$(TOP)/lib;
INCLUDES += "-I$(TOP)/include" $(_SPACE_)
LIBRARIES =+ $(_SPACE_) "/LIBPATH:$(TOP)/lib/$(_WIN_PLATFORM_)"
CUDAFE_FLAGS +=
OPENCC_FLAGS +=
PTXAS_FLAGS +=
我明确地发现,出于某种原因,来自.theanorc的FLAGS被调用了两次,如果我把它放入.theanorc两次,我得到它4次异常。 但我不知道哪里可能是那些两次提到的旗帜。 这个theano-nvcc-cuda- ??连锁工作?谁在调用nvcc并导致此问题?
顺便说一句,如果我没有指定cl-version,我会
nvcc : fatal error : nvcc cannot find a supported version of Microsoft Visual Studio. Only the versions 2008, 2010, and
2012 are supported
['nvcc', '-shared', '-O3', '-Xlinker', '/DEBUG', '-D HAVE_ROUND', '-m64', '-Xcompiler', '-DCUDA_NDARRAY_CUH=18715462c72e
d6afcd7ca5d52813ce90,-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,/Zi,/MD', '-IC:\\WinPython-64bit-2.7.10.3\\python-2.7.1
0.amd64\\lib\\site-packages\\theano\\sandbox\\cuda', '-IC:\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\lib\\site-pac
kages\\numpy\\core\\include', '-IC:\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\include', '-IC:\\WinPython-64bit-2.7
.10.3\\python-2.7.10.amd64\\lib\\site-packages\\theano\\gof', '-o', 'C:\\Users\\Kostya\\AppData\\Local\\Theano\\compiled
ir_Windows-7-6.1.7600-Intel64_Family_6_Model_42_Stepping_7_GenuineIntel-2.7.10-64\\cuda_ndarray\\cuda_ndarray.pyd', 'mod
.cu', '-LC:\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\libs', '-LC:\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64'
, '-lpython27', '-lcublas', '-lcudart']
ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: ('nvcc return status', -1, 'for cmd', 'nvcc -shared -O3
-Xlinker /DEBUG -D HAVE_ROUND -m64 -Xcompiler -DCUDA_NDARRAY_CUH=18715462c72ed6afcd7ca5d52813ce90,-DNPY_NO_DEPRECATED_AP
I=NPY_1_7_API_VERSION,/Zi,/MD -IC:\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\lib\\site-packages\\theano\\sandbox\\
cuda -IC:\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\lib\\site-packages\\numpy\\core\\include -IC:\\WinPython-64bit
-2.7.10.3\\python-2.7.10.amd64\\include -IC:\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\lib\\site-packages\\theano\
\gof -o C:\\Users\\Kostya\\AppData\\Local\\Theano\\compiledir_Windows-7-6.1.7600-Intel64_Family_6_Model_42_Stepping_7_Ge
nuineIntel-2.7.10-64\\cuda_ndarray\\cuda_ndarray.pyd mod.cu -LC:\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64\\libs -L
C:\\WinPython-64bit-2.7.10.3\\python-2.7.10.amd64 -lpython27 -lcublas -lcudart')
答案 0 :(得分:0)
似乎是theano版本的theano的问题,如下所述:github.com/Theano/Theano/issues/4091