带有 GPU 的 Theano。在上下文中使用 cuDNN 版本 5110 None

Theano with gpu. Using cuDNN version 5110 on context None

我正在尝试将 Theano 与 gpu 一起使用。我的 OS 是 Ubuntu 16.04

首先,输入 import theano 将得到

Using cuDNN version 5110 on context None
Mapped name None to device cuda0: GeForce GTX 1080 (0000:01:00.0)

要查看我的 GPU 是否正在使用,我尝试 test from theano documentation

我的 ~/.theanorc 是

[global]
device = cuda0
floatX = float32

[nvcc]
fastmath = True

在这种情况下测试说:

[GpuElemwise{exp,no_inplace}(<GpuArrayType<None>(float32, (False,))>), 
HostFromGpu(gpuarray)(GpuElemwise{exp,no_inplace}.0)]
Looping 1000 times took 0.191431 seconds
Result is [ 1.23178029  1.61879349  1.52278066 ...,  2.20771813  2.29967761 1.62323296]
Used the cpu

但是使用旧后端 device = gpu0 说:

[GpuElemwise{exp,no_inplace}(<CudaNdarrayType(float32, vector)>), HostFromGpu(GpuElemwise{exp,no_inplace}.0)]
Looping 1000 times took 0.199280 seconds
Result is [ 1.23178029  1.61879349  1.52278066 ...,  2.20771813  2.29967761 1.62323296]
Used the gpu

所以我认为cuda出了问题。我如何检查它是否正常?为什么 "context" 是 "None"?为什么测试说 "using cpu" ?

尝试用cuda替换cuda0。

我在导入 theano 后收到了相同的类似警告的文本​​:

在上下文中使用 cuDNN 版本 5110 None 映射名称 None 到设备 cuda:GeForce GT 750M (0000:01:00.0)

我继续训练了一个 DNN,我可以看到速度比我 运行 我之前在 CPU 上的代码快得多。所以,我猜文本并不意味着 GPU 不工作。