Double check after regex search for cudnn_path

This commit is contained in:
Penghao Cen 2017-08-25 12:50:48 +08:00 committed by Martin Wicke
parent 0cfd119fad
commit 01d5dff324

View File

@ -685,7 +685,9 @@ def set_tf_cunn_version(environ_cp):
ldconfig_bin = which('ldconfig') or '/sbin/ldconfig' ldconfig_bin = which('ldconfig') or '/sbin/ldconfig'
cudnn_path_from_ldconfig = run_shell([ldconfig_bin, '-p']) cudnn_path_from_ldconfig = run_shell([ldconfig_bin, '-p'])
cudnn_path_from_ldconfig = re.search('.*libcudnn.so .* => (.*)', 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)): if os.path.exists('%s.%s' % (cudnn_path_from_ldconfig, tf_cudnn_version)):
cudnn_install_path = os.path.dirname(cudnn_path_from_ldconfig) cudnn_install_path = os.path.dirname(cudnn_path_from_ldconfig)
break break