Theano / Theano

Theano was a Python library that allows you to define, optimize, and evaluate mathematical expressions involving multi-dimensional arrays efficiently. It is being continued as PyTensor: www.github.com/pymc-devs/pytensor
https://www.github.com/pymc-devs/pytensor
Other
9.9k stars 2.49k forks source link

Windows - Error when import theano #4561

Closed coroner4817 closed 7 years ago

coroner4817 commented 8 years ago

When I try to import theano, it gives me this error:

===============================
c1xx : fatal error C1083: Cannot open: “mod.cu”: No such file or directory
mod.cu

['nvcc', '-shared', '-O3', '--compiler-bindir', 'C:\\Program Files (x86)\\Micros
oft Visual Studio 12.0\\VC\\bin', '-Xlinker', '/DEBUG', '-D HAVE_ROUND', '-m32',
 '-Xcompiler', '-DCUDA_NDARRAY_CUH=18715462c72ed6afcd7ca5d52813ce90,-DNPY_NO_DEP
RECATED_API=NPY_1_7_API_VERSION,/Zi,/MD', '-IC:\\Python27\\lib\\site-packages\\t
heano\\sandbox\\cuda', '-IC:\\Python27\\lib\\site-packages\\numpy\\core\\include
', '-IC:\\Python27\\include', '-IC:\\Python27\\lib\\site-packages\\theano\\gof',
 '-o', 'C:\\Users\\wangyingnan\\AppData\\Local\\Theano\\compiledir_Windows-7-6.1
.7601-SP1-Intel64_Family_6_Model_42_Stepping_7_GenuineIntel-2.7.8-32\\cuda_ndarr
ay\\cuda_ndarray.pyd', 'mod.cu', '-LC:\\Python27\\libs', '-LC:\\Python27', '-lcu
blas', '-lpython27', '-lcudart']
ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: ('nvcc return st
atus', 2, 'for cmd', 'nvcc -shared -O3 --compiler-bindir C:\\Program Files (x86)
\\Microsoft Visual Studio 12.0\\VC\\bin -Xlinker /DEBUG -D HAVE_ROUND -m32 -Xcom
piler -DCUDA_NDARRAY_CUH=18715462c72ed6afcd7ca5d52813ce90,-DNPY_NO_DEPRECATED_AP
I=NPY_1_7_API_VERSION,/Zi,/MD -IC:\\Python27\\lib\\site-packages\\theano\\sandbo
x\\cuda -IC:\\Python27\\lib\\site-packages\\numpy\\core\\include -IC:\\Python27\
\include -IC:\\Python27\\lib\\site-packages\\theano\\gof -o C:\\Users\\wangyingn
an\\AppData\\Local\\Theano\\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_M
odel_42_Stepping_7_GenuineIntel-2.7.8-32\\cuda_ndarray\\cuda_ndarray.pyd mod.cu
-LC:\\Python27\\libs -LC:\\Python27 -lcublas -lpython27 -lcudart')
WARNING (theano.sandbox.cuda): CUDA is installed, but device gpu is not availabl
e  (error: cuda unavailable)

However, the mod.cu file is located at the C:\Users\XXX\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_42_Stepping_7_GenuineIntel-2.7.8-32\cuda_ndarray\

My theanorc file has:

[global]
floatX=float32
device=gpu
mode=FAST_RUN

[blas]
ldflags=-LC:\\openBLAS -lopenblas

[cuda]
root = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0

[nvcc]
compiler_bindir = C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin

I installed CUDA 7.0 and the GPU is GT540M. It's an old gpu but it should works. Can anyone help me with my case? THX!

lamblin commented 8 years ago

Since you have spaces in some of your paths, maybe it will help to put quotation marks around them.

masakinakada commented 7 years ago

I have the same error Having quotation did not solve the problem on win 10. Could anyone help?

coroner4817 commented 7 years ago

@masakinakada have you ever changed anything in your registry? In my case, I figured out that I have previously used registry to set the starting directory of the cmd to D drive using autorun. Remove that the error is fixed.

masakinakada commented 7 years ago

@coroner4817 Thank you very much Yingnan,

I do not recall I changed anything in the registry. Could you tell me which one might cause the error? I did not change it manually, but some of softwares might change it automatically...

Again, thank you so much!

On Mon, Dec 26, 2016 at 10:57 PM, Yingnan Wang notifications@github.com wrote:

@masakinakada https://github.com/masakinakada have you ever changed anything in your registry? In my case, I figured out that I have previously used registry to set the starting directory of the cmd to D drive using autorun. VS will run this autorun before build. Remove that the error is fixed.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Theano/Theano/issues/4561#issuecomment-269279551, or mute the thread https://github.com/notifications/unsubscribe-auth/ADU4RMTabWQZnB0bH7zqPp_j4L_aw56Sks5rMLbsgaJpZM4IphEP .

coroner4817 commented 7 years ago

@masakinakada Something like this: http://stackoverflow.com/a/4896002/4812471

lamblin commented 7 years ago

Closing as we removed the old GPU back-end. Now we suggest to use pre-compiled conda packages for Theano and libgpuarray rather than trying to compile it with Visual Studio.

masakinakada commented 7 years ago

Thank you very much Yingnan and Pascal!

On Fri, Jun 9, 2017 at 11:13 AM, Pascal Lamblin notifications@github.com wrote:

Closed #4561 https://github.com/Theano/Theano/issues/4561.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Theano/Theano/issues/4561#event-1117698900, or mute the thread https://github.com/notifications/unsubscribe-auth/ADU4RDNwkPCNBtEoRQT9W0mSb4vCnKYMks5sCYswgaJpZM4IphEP .