Theano: Tried to update backend, nothing has changed

Created on 16 Jun 2017  路  5Comments  路  Source: Theano/Theano

As theano has been requesting for a while, I tried switching to the gpuarray backend. But it seems that the instructions are not sufficiently foolproof?

I am using Windows. This is what I've done:

set up a new environment in anaconda, with python=3.5
Gone through http://deeplearning.net/software/theano_versions/dev/install_windows.html, making sure numpy, scipy, blas, mingw, nose, sphinx, pygments, pydot-ng, libgpuarray, pycuda and skcuda are installed in the new environment, with the right versions. Since I already had nvidia cuda drivers from my last install, I did not touch those.

I then typed conda install theano pygpu and let that run.

Finally "pip install keras", which should have me ready to go.

I fire up spyder, having activated the new environment - and I still get the

"WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will be removed in the next release (v0.10). Please switch to the gpuarray backend. You can get more information about how to switch at this URL:
https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29"

My $USER/.theanorc looks like this:

[global]
floatX = float32
device = gpu

[nvcc]
flags=-LC:UserskaareAnaconda3libs
compiler_bindir=C:Program Files (x86)Microsoft Visual Studio 14.0VCbin

According to https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29, I should be able to remove the nvcc settings, but it seems that their existence should not be dictating anything?

What is it that I don't understand?

All 5 comments

You have to set deviceto cuda in your .theanorc in order to use the new backend.

ok, changing that, I get this instead. can't tell if that's an improvement?

Using Theano backend.
C:UserskaareAnaconda3envspy35_2libsite-packagesskcudacublas.py:282: UserWarning: creating CUBLAS context to get version number
warnings.warn('creating CUBLAS context to get version number')
Can not use cuDNN on context None: cannot compile with cuDNN. We got this error:
b'C:\Users\kaare\AppData\Local\Temp\try_flags_qvb1ond_.c:4:19: fatal error: cudnn.h: No such file or directoryrncompilation terminated.rn'
Mapped name None to device cuda: GeForce GTX 960M (0000:01:00.0)

(I should mention that CUBLAS was also emitting a warning before))

Looks like that the compiler is not able to find the header file for cudnn. You can try to specify the path in your config as well using:

[dnn]
include_path=/path/to/header
library_path=/path/to/lib

(I assume that cudnn is installed)

btw, "Mapped name None to device cuda: GeForce GTX 960M (0000:01:00.0)" tells you that the new backend is used

hi, I have the same issue:
I try to import theano in cmd, and get the error:

Can not use cuDNN on context None: cannot compile with cuDNN. We got this error:
b'C:\Users\Xyq\AppData\Local\Temp\try_flags_8kb5t0jx.c:4:19: fatal error: cudnn.h: No such file or directoryrncompilation terminated.rn'
Mapped name None to device cuda: Quadro K2200 (0000:01:00.0)

And I try to specify the path in my config, but my python just quit for no reason
I used windows10, VS2015, cudnn5.1, cuda8.0, python3.5, and theano9.0

and this is my .theanorc.txt
[global]
openmp=False
floatX=float32
device=cuda
[gcc]
cxxflags=-IC:UsersXyqAnaconda3MinGW
allow_input_downcast=True
[lib]
cnmem=0.8
[blas]
ldflas=
[nvcc]
flags=-LC:UsersXyqAnaconda3libs
compiler_bindir=C:Program Files (x86)Microsoft Visual Studio 14.0VCbinx86_amd64
fastmath=True
[cuda]
root=-LC:Program FilesNVIDIA GPU Computing ToolkitCUDAv8.0
[dnn]
include_path=C:Program FilesNVIDIA GPU Computing ToolkitCUDAv8.0include
library_path=C:Program FilesNVIDIA GPU Computing ToolkitCUDA/v8.0libx64

and I use pycharme to test instead of just import theano in cmd I meet the problem like
https://stackoverflow.com/questions/44330484/i-cause-error-when-i-switched-to-use-gpuarray-backend-instead-cuda-backend
how can I do?

Was this page helpful?
0 / 5 - 0 ratings