简体   繁体   中英

Error while importing Theano in Windows

I am trying to use Theano for Deep Learning in Windows 7. I have installed Visual Studio Community Edition 2013 . And CUDA Toolkit 7.5 . I am using Anaconda environment for Python.

But when I import Theano I encounter the following command line message.

ERROR:theano.sandbox.cuda:Failed to compile cuda_ndarray.cu: ('nvcc return statu s', 2, 'for cmd', 'nvcc -shared -O3-LC:\\Users\\hp\\Anaconda2\\libs -use_fast_m ath --compiler-bindir C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\ \bin\\amd64-Xlinker /DEBUG -D HAVE_ROUND -m64 -Xcompiler -DCUDA_NDARRAY_CUH=187 15462c72ed6afcd7ca5d52813ce90,-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,/Zi,/MD -IC:\\Users\\hp\\Anaconda2\\lib\\site-packages\\theano\\sandbox\\cuda -IC:\\Us ers\\hp\\Anaconda2\\lib\\site-packages\\numpy\\core\\include -IC:\\Users\\hp\\An aconda2\\include -IC:\\Users\\hp\\Anaconda2\\lib\\site-packages\\theano\\gof -o C:\\Users\\hp\\AppData\\Local\\Theano\\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-2.7.12-64\\cuda_ndarray\\cuda_ndarray.pyd mod.cu -LC:\\Users\\hp\\Anaconda2\\libs-LC:\\Users\\hp\\Anaconda2 -lcublas  -lpython27 -lcudart')

My Config file(.theanorc) looks like this::

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

    [cuda]
    root = C:\Program Files\NVIDIA Corporation\Installer2\CUDAToolkit_7.5


    [nvcc]
    flags = -LC:\Users\hp\Anaconda2\libs
    compiler_bindir = C:\Program Files (x86)\Microsoft Visual Studio12.0\VC\bin\amd64  
    fastmath = True

Please help

I am not sure if this is the error, but you should change this line:

flags = -LC:\Users\hp\Anaconda2\libs

It is looking in -LC:\\Users\\hp\\Anaconda2\\libs instead of C:\\Users\\hp\\Anaconda2\\libs .

You should use quotes in directories; also, I had similar errors, until I removed the compliler_bindir line. I suggest you start with this minimal .theanorc file:

[global]
floatX = float32
device = gpu

[nvcc]
flags=-L"C:\Users\hp\Anaconda2\libs"

provided of course that the flags path is the correct one...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM