Windows 上的 Tensorflow 自定义编译

标签 tensorflow compilation bazel cudnn

所以,我已经通过 Chocolatey 安装了 Bazel,安装了 Python 3.5 和 2.7,安装了 CUDA v8 和 cuDNN v6,并安装了 JDK 8.0,我现在尝试使用 AVX 在我的 Windows 10 设备上自定义构建 TensorFlow 、AVX 2 和 CUDA。预构建版本 TensorFlow-GPU 确实可以工作,我已经测试并成功运行了它。

我已按照其他文章的说明进行操作,这些文章均位于 TensorFlows 的实际站点(尝试改编 Linux/Mac 安装中的某些部分)和此处。我已经做到的最远的是;通过 Msys2 克隆 Github 存储库,运行 configure.py,然后尝试通过 bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package 进行构建我收到一个错误,其 header 为:

Error reading java.io.IOException: CreateProcess(): The system cannot find the file specified. : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/include/cudnn.h

我已经仔细检查过,该文件确实存在,所以我不确定为什么会收到此错误。

编辑:还尝试通过 Powershell 运行,达到相同的点。

任何帮助将不胜感激。

最佳答案

我在 Windows 上尝试构建 Tensorflow(使用 cuDNN 5.1)时遇到了完全相同的错误。我通过从 msys2 终端(而不是从 Windows 命令提示符)启动 bazel 并在尝试构建之前手动设置 BAZEL_SH 环境变量来修复它。

export BAZEL_SH=c:/tools/msys64/usr/bin/bash.exe
bazel build -c opt --config=win-cuda tensorflow/cc:cc_ops

关于Windows 上的 Tensorflow 自定义编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45962365/

相关文章:

无法使用 libyahoo2 编译应用程序

c++ - 项目编译错误 - 找不到 -lwxmsw28

scala - Scala 编译器可以使用多核 CPU 吗?

tensorflow - 如何检查Bazel版本?

python - 如何有条件地缩放 Keras Lambda 层中的值?

tensorflow - 有没有办法使用 Tensorflow(使用 Keras)或 PyTorch 删除 NN 层之间的 1-2(或更多)特定神经元连接?

android - 为 android 构建 tensorflow 时出现 Bazel 错误 "this rule is missing dependency declarations for the following files"

zip - 如何在 bazel 中压缩文件

tensorflow - sklearn.preprocessing 中的 LabelEncoder 是否有类似的方法?

python - Tensorflow 的 'Label_image.py' 在循环中越来越慢