提交 5be27af0 authored 作者: Frédéric Bastien's avatar Frédéric Bastien 提交者: GitHub

Merge pull request #5427 from notoraptor/investigation-5143

Add user warning to prevent issue #5143
...@@ -720,6 +720,11 @@ class GpuDnnConvGradW(DnnBase): ...@@ -720,6 +720,11 @@ class GpuDnnConvGradW(DnnBase):
return defs return defs
def make_node(self, img, topgrad, output, desc, alpha=None, beta=None): def make_node(self, img, topgrad, output, desc, alpha=None, beta=None):
if img.type.ndim == 5 and self.algo != 'none' and desc.owner.op.subsample != (1, 1, 1):
warnings.warn('cuDNN backward filter operation for 3D convolutions may produce bad results '
'with certain cuDNN algorithms depending on the compute capability of your GPU '
'if subsample is not (1, 1, 1). If you encounter problems, consider '
'setting the theano flag "dnn.conv.algo_bwd_filter" to "none".')
ctx_name = infer_context_name(img, topgrad, output) ctx_name = infer_context_name(img, topgrad, output)
img = as_gpuarray_variable(img, ctx_name) img = as_gpuarray_variable(img, ctx_name)
topgrad = as_gpuarray_variable(topgrad, ctx_name) topgrad = as_gpuarray_variable(topgrad, ctx_name)
......
...@@ -973,7 +973,6 @@ def get_conv3d_test_cases(): ...@@ -973,7 +973,6 @@ def get_conv3d_test_cases():
[(8, 4, 20, 12, 15), (5, 4, 6, 12, 4), (2, 2, 2)], [(8, 4, 20, 12, 15), (5, 4, 6, 12, 4), (2, 2, 2)],
[(8, 1, 20, 12, 15), (5, 1, 6, 12, 4), (3, 3, 3)], [(8, 1, 20, 12, 15), (5, 1, 6, 12, 4), (3, 3, 3)],
[(8, 1, 20, 12, 15), (5, 1, 6, 12, 4), (3, 2, 1)], [(8, 1, 20, 12, 15), (5, 1, 6, 12, 4), (3, 2, 1)],
[(8, 1, 20, 12, 15), (5, 1, 6, 12, 4), (3, 2, 1)],
# Test with 1x1x1 filters # Test with 1x1x1 filters
[(8, 1, 10, 10, 10), (10, 1, 1, 1, 1), (1, 1, 1)], [(8, 1, 10, 10, 10), (10, 1, 1, 1, 1), (1, 1, 1)],
# Test with dimensions larger than 1024 (thread block dim) # Test with dimensions larger than 1024 (thread block dim)
......
...@@ -789,6 +789,11 @@ class GpuDnnConv3dGradW(GpuDnnConvGradW): ...@@ -789,6 +789,11 @@ class GpuDnnConv3dGradW(GpuDnnConvGradW):
DisconnectedType()(), d_alpha, d_beta) DisconnectedType()(), d_alpha, d_beta)
def make_node(self, img, topgrad, output, desc, alpha=None, beta=None): def make_node(self, img, topgrad, output, desc, alpha=None, beta=None):
if self.algo != 'none' and desc.owner.op.subsample != (1, 1, 1):
warnings.warn('cuDNN backward filter operation for 3D convolutions may produce bad results '
'with certain cuDNN algorithms depending on the compute capability of your GPU '
'if subsample is not (1, 1, 1). If you encounter problems, consider '
'setting the theano flag "dnn.conv.algo_bwd_filter" to "none".')
img = as_cuda_ndarray_variable(img) img = as_cuda_ndarray_variable(img)
topgrad = as_cuda_ndarray_variable(topgrad) topgrad = as_cuda_ndarray_variable(topgrad)
output = as_cuda_ndarray_variable(output) output = as_cuda_ndarray_variable(output)
......
...@@ -1554,7 +1554,6 @@ def get_conv3d_test_cases(): ...@@ -1554,7 +1554,6 @@ def get_conv3d_test_cases():
[(8, 4, 20, 12, 15), (5, 4, 6, 12, 4), (2, 2, 2)], [(8, 4, 20, 12, 15), (5, 4, 6, 12, 4), (2, 2, 2)],
[(8, 1, 20, 12, 15), (5, 1, 6, 12, 4), (3, 3, 3)], [(8, 1, 20, 12, 15), (5, 1, 6, 12, 4), (3, 3, 3)],
[(8, 1, 20, 12, 15), (5, 1, 6, 12, 4), (3, 2, 1)], [(8, 1, 20, 12, 15), (5, 1, 6, 12, 4), (3, 2, 1)],
[(8, 1, 20, 12, 15), (5, 1, 6, 12, 4), (3, 2, 1)],
# Test with 1x1x1 filters # Test with 1x1x1 filters
[(8, 1, 10, 10, 10), (10, 1, 1, 1, 1), (1, 1, 1)], [(8, 1, 10, 10, 10), (10, 1, 1, 1, 1), (1, 1, 1)],
# Test with dimensions larger than 1024 (thread block dim) # Test with dimensions larger than 1024 (thread block dim)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论