提交 f37172c1 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Merge pull request #2425 from nouiz/dnn

Crash fix in dnn_available when CUDA isn't available.
......@@ -40,6 +40,14 @@ To get an error if Theano can not use cuDNN, use this Theano flag:
currently does not allow all options supported by cuDNN ops. So it is
possible that you will need to call them manually.
.. note::
The documentation of CUDNN R1 and R2 tells that, for the following
2 operations, the reproducibility is not guaranteed:
`cudnnConvolutionBackwardFilter` and `cudnnConvolutionBackwardData`.
Those correspond to the gradient wrt the weights and the gradient wrt the
input of the convolution. They are also used sometimes in the forward
pass, when they give a speed up.
Functions
=========
......
......@@ -8,6 +8,12 @@
This is not in the released version 0.6.0, but will be in the next release (0.7 or 0.6.1).
.. note::
This works, but is not well integrated with the rest of Theano. If
speed is important, it is probably better to pad to a dense
tensor.
This is a type that represents a list in Theano. All elements must have
the same Theano type. Here is an example::
......
......@@ -14,6 +14,16 @@ compilation. These two functions print expression graphs in different ways:
Theano also provides :func:`pydotprint` that creates a *png* image of the function.
You can read about them in :ref:`libdoc_printing`.
.. note::
When printing Theano functions, they can sometimes be hard to
read. To help with this, you can disable some Theano optimizations
by using the Theano flag:
``optimizer_excluding=fusion:inplace``. Do not use this during
real job execution, as this will make the graph slower and use more
memory.
Consider again the logistic regression but notice the additional printing instuctions.
The following output depicts the pre- and post- compilation graphs.
......
......@@ -23,6 +23,10 @@ from theano.sandbox.cuda.nvcc_compiler import NVCC_compiler
def dnn_available():
if dnn_available.avail is None:
if not theano.sandbox.cuda.cuda_available:
dnn_available.msg = "CUDA not available"
dnn_available.avail = False
return False
dev = theano.sandbox.cuda.active_device_number()
if theano.sandbox.cuda.device_properties(dev)['major'] < 3:
dnn_available.msg = "Device not supported by cuDNN"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论