提交 fdf643c0 authored 作者: notoraptor's avatar notoraptor

Print the warning for conv3d backward operation only if subsample is not (1, 1, 1).

上级 5d72e115
...@@ -720,11 +720,12 @@ class GpuDnnConvGradW(DnnBase): ...@@ -720,11 +720,12 @@ 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': if img.type.ndim == 5 and self.algo != 'none' and desc.owner.op.subsample != (1, 1, 1):
warnings.warn('cuDNN backward filter convolution computation for 3D convolutions ' warnings.warn('cuDNN backward filter operation for 3D convolutions may produce bad results '
'may produce bad results with certain algorithms depending on the compute capability ' 'with certain cuDNN algorithms depending on the compute capability of your GPU '
'of your GPU. If you encounter problems, consider setting the theano flag ' 'if subsample is not (1, 1, 1). If you encounter problems, consider '
'"dnn.conv.algo_bwd_filter" to "none" (dnn.conv.algo_bwd_filter=none)') 'setting the theano flag "dnn.conv.algo_bwd_filter" to "none" '
'(dnn.conv.algo_bwd_filter=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)
......
...@@ -789,11 +789,12 @@ class GpuDnnConv3dGradW(GpuDnnConvGradW): ...@@ -789,11 +789,12 @@ 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': if self.algo != 'none' and desc.owner.op.subsample != (1, 1, 1):
warnings.warn('cuDNN backward filter convolution computation for 3D convolutions ' warnings.warn('cuDNN backward filter operation for 3D convolutions may produce bad results '
'may produce bad results with certain algorithms depending on the compute capability ' 'with certain cuDNN algorithms depending on the compute capability of your GPU '
'of your GPU. If you encounter problems, consider setting the theano flag ' 'if subsample is not (1, 1, 1). If you encounter problems, consider '
'"dnn.conv.algo_bwd_filter" to "none" (dnn.conv.algo_bwd_filter=none)') 'setting the theano flag "dnn.conv.algo_bwd_filter" to "none" '
'(dnn.conv.algo_bwd_filter=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)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论