提交 3792889d authored 作者: Frederic's avatar Frederic

Crash fix in dnn_available when CUDA isn't available.

上级 f81ece7f
...@@ -23,6 +23,10 @@ from theano.sandbox.cuda.nvcc_compiler import NVCC_compiler ...@@ -23,6 +23,10 @@ from theano.sandbox.cuda.nvcc_compiler import NVCC_compiler
def dnn_available(): def dnn_available():
if dnn_available.avail is None: 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() dev = theano.sandbox.cuda.active_device_number()
if theano.sandbox.cuda.device_properties(dev)['major'] < 3: if theano.sandbox.cuda.device_properties(dev)['major'] < 3:
dnn_available.msg = "Device not supported by cuDNN" dnn_available.msg = "Device not supported by cuDNN"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论