简体   繁体   English

在Windows 10上获取cudnn.h的bazel构建tensorflow-系统找不到指定的文件

[英]bazel build tensorflow on windows 10 getting cudnn.h- system cannot find the file specified

I keep getting this error when trying to build the tensorflow-gpu using bazel and python in Windows 10: 在Windows 10中尝试使用bazel和python构建tensorflow-gpu时,我不断收到此错误消息:

Cuda Configuration Error: Error reading C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.2/cuda/include/cudnn.h: ja
va.io.IOException: ERROR: src/main/native/windows/processes-jni.cc(239): CreateProcessW("grep" --color=never -A1 -E "#de
fine CUDNN_MAJOR" "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.2/cuda/include/cudnn.h"): The system cannot fin
d the file specified.

This is the command I'm trying to run: 这是我要运行的命令:

bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package

I've confirmed the C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.2/cuda/include/cudnn.h is there. 我已经确认C:/ Program Files / NVIDIA GPU Computing Toolkit / CUDA / v9.2 / cuda / include / cudnn.h在那里。

I've tried running it from VS2015 x64 Native Tools Command Prompt, cmd, and powershell and get the same error. 我试过从VS2015 x64本机工具命令提示符,cmd和powershell运行它,并得到相同的错误。

I'm using bazel 0.16.1, CUDA 9.2, Anaconda3 (Python 3.6.5), and CUDNN 7.2.1. 我正在使用bazel 0.16.1,CUDA 9.2,Anaconda3(Python 3.6.5)和CUDNN 7.2.1。 I "installed" the CUDDNN files by unzipping its cuda folder into my C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2 folder (ie the whole "cuda" folder). 通过将其cuda文件夹解压缩到我的C:\\ Program Files \\ NVIDIA GPU Computing Toolkit \\ CUDA \\ v9.2文件夹(即整个“ cuda”文件夹)中,我“安装”了CUDDNN文件。 I specified the C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2\\cuda path in the cudnn path question when I ran the configure.py. 我在运行configure.py时在cudnn路径问题中指定了C:\\ Program Files \\ NVIDIA GPU Computing Toolkit \\ CUDA \\ v9.2 \\ cuda路径。 The configure.py completes without error. configure.py完成,没有错误。

I also tried putting the CUDNN files directly in the C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2 folder (instead of a cuda folder in there) and specified the default location and still get basically the same error: "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.2/include/cudnn.h": The system cannot find the file specified. 我还尝试将CUDNN文件直接放置在C:\\ Program Files \\ NVIDIA GPU Computing Toolkit \\ CUDA \\ v9.2文件夹(而不是其中的cuda文件夹)中,并指定默认位置,并且仍然得到基本相同的错误:“ C:/ Program Files / NVIDIA GPU Computing Toolkit / CUDA / v9.2 / include / cudnn.h“:系统找不到指定的文件。

I've added these to my path (and rebooted): 我已经将它们添加到我的路径中(并重新启动):

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\libnvvp
C:\tools\msys64
C:\tools\bazel
C:\tools\bazel\bazel.exe
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\extras\CUPTI\libx64

These are the system variables I've set: 这些是我设置的系统变量:

BAZEL_SH  C:\tools\msys64\usr\bin\bash.exe
BAZEL_VC  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
BAZEL_VS  C:\Program Files (x86)\Microsoft Visual Studio 14.0

This is the full error: 这是完整的错误:

ERROR: Skipping '//tensorflow/tools/pip_package:build_pip_package': error loading package 'tensorflow/tools/pip_package'
: Encountered error while reading extension file 'cuda/build_defs.bzl': no such package '@local_config_cuda//cuda': Trac
eback (most recent call last):
        File "C:/tensorflow/third_party/gpus/cuda_configure.bzl", line 1458
                _create_local_cuda_repository(repository_ctx)
        File "C:/tensorflow/third_party/gpus/cuda_configure.bzl", line 1185, in _create_local_cuda_repository
                _get_cuda_config(repository_ctx)
        File "C:/tensorflow/third_party/gpus/cuda_configure.bzl", line 909, in _get_cuda_config
                _cudnn_version(repository_ctx, cudnn_install_base..., ...)
        File "C:/tensorflow/third_party/gpus/cuda_configure.bzl", line 584, in _cudnn_version
                find_cuda_define(repository_ctx, cudnn_header_dir, "c...", ...)
        File "C:/tensorflow/third_party/gpus/cuda_configure.bzl", line 534, in find_cuda_define
                auto_configure_fail(("Error reading %s: %s" % (str(h...)))
        File "C:/tensorflow/third_party/gpus/cuda_configure.bzl", line 315, in auto_configure_fail
                fail(("\n%sCuda Configuration Error:%...)))

Cuda Configuration Error: Error reading C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.2/cuda/include/cudnn.h: ja
va.io.IOException: ERROR: src/main/native/windows/processes-jni.cc(239): CreateProcessW("grep" --color=never -A1 -E "#de
fine CUDNN_MAJOR" "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.2/cuda/include/cudnn.h"): The system cannot fin
d the file specified.

WARNING: Target pattern parsing failed.
ERROR: error loading package 'tensorflow/tools/pip_package': Encountered error while reading extension file 'cuda/build_
defs.bzl': no such package '@local_config_cuda//cuda': Traceback (most recent call last):
        File "C:/tensorflow/third_party/gpus/cuda_configure.bzl", line 1458
                _create_local_cuda_repository(repository_ctx)
        File "C:/tensorflow/third_party/gpus/cuda_configure.bzl", line 1185, in _create_local_cuda_repository
                _get_cuda_config(repository_ctx)
        File "C:/tensorflow/third_party/gpus/cuda_configure.bzl", line 909, in _get_cuda_config
                _cudnn_version(repository_ctx, cudnn_install_base..., ...)
        File "C:/tensorflow/third_party/gpus/cuda_configure.bzl", line 584, in _cudnn_version
                find_cuda_define(repository_ctx, cudnn_header_dir, "c...", ...)
        File "C:/tensorflow/third_party/gpus/cuda_configure.bzl", line 534, in find_cuda_define
                auto_configure_fail(("Error reading %s: %s" % (str(h...)))
        File "C:/tensorflow/third_party/gpus/cuda_configure.bzl", line 315, in auto_configure_fail
                fail(("\n%sCuda Configuration Error:%...)))

Cuda Configuration Error: Error reading C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.2/cuda/include/cudnn.h: ja
va.io.IOException: ERROR: src/main/native/windows/processes-jni.cc(239): CreateProcessW("grep" --color=never -A1 -E "#de
fine CUDNN_MAJOR" "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.2/cuda/include/cudnn.h"): The system cannot fin
d the file specified.

Any ideas what I could have done wrong, or what I might have missed, or what I could check next? 有什么想法我可能做错了什么,或者我可能错过了什么,或者接下来我可以检查什么?

The problem is a bug in cuda_configure.bzl : it uses ctx.execute instead of ctx.action.run_shell . 问题是cuda_configure.bzl的错误:它使用ctx.execute而不是ctx.action.run_shell If you'd be so kind to file a bug to TensorFlow , that'd be great! 如果您愿意向TensorFlow提交错误 ,那就太好了!

To work around it: add c:\\tools\\msys64\\usr\\bin to your PATH. 要解决此问题,请执行以下操作:将c:\\tools\\msys64\\usr\\bin到PATH。 That's where grep.exe is so ctx.execute can find grep on the PATH. 那就是grep.exe所在的grep.exe ,因此ctx.execute可以在PATH上找到grep

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 构建 Tensorflow 错误“找不到 bazel。 请安装 bazel” - Build Tensorflow Error “Cannot find bazel. Please install bazel” Python:系统找不到指定的路径,Tensorflow - Python: The system cannot find the path specified , Tensorflow Windows Jupyter笔记本上的RPy2:系统找不到指定的文件 - RPy2 on Windows Jupyter notebook: The system cannot find the file specified 系统找不到Windows指定的文件错误python - The system cannot find the file specified windows error python makefile无法在Windows中编译:系统找不到指定的文件 - makefile won't compile in windows: The system cannot find the file specified 为什么Windows会显示系统找不到指定的文件? - why windows shows The system cannot find the file specified? conda环境激活报错:“系统找不到指定的路径。” (窗户 10) - Conda environment activation error: “The system cannot find the path specified.” (windows 10) 无法构建 docker-compose - 出现错误系统找不到指定的路径 - Not able to build docker-compose up - getting error The system cannot find the path specified Windows 10上Tensorflow GPU版本CNN CuDNN错误 - Tensorflow GPU version CNN CuDNN error on Windows 10 如何在windows命令promt中创建一个django项目,我收到错误“系统找不到指定的路径” - how to create a django project in windows command promt, i am getting an error of “the system cannot find the the path specified”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM