how to setup cuDnn with theano on Windows 7 64 bit

I have installed Theano framework and enabled CUDA on my machine, however when I “import theano” in my python console, I got the following message:

>>> import theano
Using gpu device 0: GeForce GTX 950 (CNMeM is disabled, CuDNN not available)

Now that “CuDNN not available”, I downloaded cuDnn from Nvidia website. I also updated ‘path’ in environment, and added ‘optimizer_including=cudnn’ in ‘.theanorc.txt’ config file.

Then, I tried again, but failed, with:

>>> import theano
Using gpu device 0: GeForce GTX 950 (CNMeM is disabled, CuDNN not available)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:Anaconda2libsite-packagestheano__init__.py", line 111, in <module>
    theano.sandbox.cuda.tests.test_driver.test_nvidia_driver1()
  File "C:Anaconda2libsite-packagestheanosandboxcudateststest_driver.py", line 31, in test_nvidia_driver1
    profile=False)
  File "C:Anaconda2libsite-packagestheanocompilefunction.py", line 320, in function
    output_keys=output_keys)
  File "C:Anaconda2libsite-packagestheanocompilepfunc.py", line 479, in pfunc
    output_keys=output_keys)
  File "C:Anaconda2libsite-packagestheanocompilefunction_module.py", line 1776, in orig_function
    output_keys=output_keys).create(
  File "C:Anaconda2libsite-packagestheanocompilefunction_module.py", line 1456, in __init__
    optimizer_profile = optimizer(fgraph)
  File "C:Anaconda2libsite-packagestheanogofopt.py", line 101, in __call__
    return self.optimize(fgraph)
  File "C:Anaconda2libsite-packagestheanogofopt.py", line 89, in optimize
    ret = self.apply(fgraph, *args, **kwargs)
  File "C:Anaconda2libsite-packagestheanogofopt.py", line 230, in apply
    sub_prof = optimizer.optimize(fgraph)
  File "C:Anaconda2libsite-packagestheanogofopt.py", line 89, in optimize
    ret = self.apply(fgraph, *args, **kwargs)
  File "C:Anaconda2libsite-packagestheanogofopt.py", line 230, in apply
    sub_prof = optimizer.optimize(fgraph)
  File "C:Anaconda2libsite-packagestheanogofopt.py", line 89, in optimize
    ret = self.apply(fgraph, *args, **kwargs)
  File "C:Anaconda2libsite-packagestheanosandboxcudadnn.py", line 2508, in apply
    dnn_available.msg)
AssertionError: cuDNN optimization was enabled, but Theano was not able to use it. We got this error:
Theano can not compile with cuDNN. We got this error:

>>>

anyone can help me? Thanks.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

There should be a way to do it by setting only the Path environment variable but I could never get that to work. The only thing that worked for me was to manually copy the CuDNN files into the appropriate folders in your CUDA installation.

For example, if your CUDA installation is in C:CUDAv7.0 and you extracted CuDNN to C:CuDNN you would copy as follows:

  • The contents of C:CuDNNlibx64 would be copied to C:CUDAv7.0libx64
  • The contents of C:CuDNNinclude would be copied to C:CUDAv7.0include
  • The contents of C:CuDNNbin would be copied to C:CUDAv7.0bin

After that it should work.

Method 2

In addition to all the stuffs you did I updated following content of .theanorc.txt in my home folder and it worked after that.

[lib] 
#cnmem=1.0 
cudnn=1.0


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x