1

我是 Theano 的新手。遵循本指南后:http : //deeplearning.net/software/theano/install_windows.html#install-windows 我设法正确使用 theano。后来我升级到 theano dev 版本,现在我不断收到这个异常:

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')
4

1 回答 1

0

似乎是theano的开发版本中的问题,如此处所述:github.com/Theano/Theano/issues/4091

于 2016-11-16T17:36:59.890 回答