From 01d5dff324744a3089b5096e9dd9f8fdc3bede6e Mon Sep 17 00:00:00 2001 From: Penghao Cen Date: Fri, 25 Aug 2017 12:50:48 +0800 Subject: [PATCH] Double check after regex search for cudnn_path --- configure.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.py b/configure.py index 186fdc9ddce..b49cdf23832 100644 --- a/configure.py +++ b/configure.py @@ -685,7 +685,9 @@ def set_tf_cunn_version(environ_cp): ldconfig_bin = which('ldconfig') or '/sbin/ldconfig' cudnn_path_from_ldconfig = run_shell([ldconfig_bin, '-p']) cudnn_path_from_ldconfig = re.search('.*libcudnn.so .* => (.*)', - cudnn_path_from_ldconfig).group(1) + cudnn_path_from_ldconfig) + if cudnn_path_from_ldconfig != None: + cudnn_path_from_ldconfig = cudnn_path_from_ldconfig.group(1) if os.path.exists('%s.%s' % (cudnn_path_from_ldconfig, tf_cudnn_version)): cudnn_install_path = os.path.dirname(cudnn_path_from_ldconfig) break