提交 56a39445 authored 作者: notoraptor's avatar notoraptor

Show user warning in old and new backend when Theano flags…

Show user warning in old and new backend when Theano flags `dnn.conv.algo_bwd_filter` is not `none`, to help user prevent the issue #5143.
上级 598991d7
...@@ -1135,6 +1135,11 @@ def dnn_conv3d(img, kerns, border_mode='valid', subsample=(1, 1, 1), ...@@ -1135,6 +1135,11 @@ def dnn_conv3d(img, kerns, border_mode='valid', subsample=(1, 1, 1),
desc_op.subsample) desc_op.subsample)
out_shp = assert_conv_shape(out_shp) out_shp = assert_conv_shape(out_shp)
out = gpu_alloc_empty(ctx_name, dtype=img.dtype)(*out_shp) out = gpu_alloc_empty(ctx_name, dtype=img.dtype)(*out_shp)
if config.dnn.conv.algo_bwd_filter != 'none':
warnings.warn('[new backend] cuDNN backward filter convolution computation for 3D convolutions '
'may produce bad results with certain algorithms depending on the compute capability '
'of your GPU. If you encounter problems, consider setting the theano flag '
'"dnn.conv.algo_bwd_filter" to "none" (dnn.conv.algo_bwd_filter=none)')
return gpu_dnn_conv(algo=algo)(img, kerns, out, desc) return gpu_dnn_conv(algo=algo)(img, kerns, out, desc)
......
...@@ -763,12 +763,17 @@ class GpuDnnConv3dGradW(GpuDnnConvGradW): ...@@ -763,12 +763,17 @@ class GpuDnnConv3dGradW(GpuDnnConvGradW):
good_algo = ['none', 'small', good_algo = ['none', 'small',
'guess_once', 'guess_on_shape_change', 'guess_once', 'guess_on_shape_change',
'time_once', 'time_on_shape_change'] 'time_once', 'time_on_shape_change']
if algo is None:
algo = config.dnn.conv.algo_bwd_filter
if version() < (5000, 5000) and algo == 'small': if version() < (5000, 5000) and algo == 'small':
algo = 'guess_once' algo = 'guess_once'
elif algo is None and config.dnn.conv.algo_bwd_filter not in good_algo: elif algo not in good_algo:
algo = 'guess_once'
elif algo is not None and algo not in good_algo:
algo = 'guess_once' algo = 'guess_once'
if algo != 'none':
warnings.warn('[old backend] cuDNN backward filter convolution computation for 3D convolutions '
'may produce bad results with certain algorithms depending on the compute capability '
'of your GPU. If you encounter problems, consider setting the theano flag '
'"dnn.conv.algo_bwd_filter" to "none" (dnn.conv.algo_bwd_filter=none)')
super(GpuDnnConv3dGradW, self).__init__(inplace=inplace, super(GpuDnnConv3dGradW, self).__init__(inplace=inplace,
algo=algo) algo=algo)
assert self.algo in good_algo assert self.algo in good_algo
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论