Tensorflow Custom Compile on Windows

≯℡__Kan透↙ 提交于 2019-12-11 02:11:57

问题


So, I've installed Bazel via Chocolatey, installed Python 3.5 and 2.7, installed CUDA v8, and cuDNN v6, and installed JDK 8.0, I'm now trying to custom-build TensorFlow on my Windows 10 device, with AVX, AVX 2 and CUDA. TensorFlow-GPU, the pre-built version, does work, I've already tested and run that successfully.

I've followed the instructions of other articles, both on TensorFlows' actual site (trying to adapt some sections from the Linux/Mac installs), and on here. The furthest I've made it is; cloning the Github repository via Msys2, running configure.py, then attempting to build via bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package I receive an error, the header of which is:

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

I've double checked, that file does exist, so I'm not sure why I'm getting this error.

EDIT: Also attempted to run via Powershell, reached the same point.

Any help would be much appreciated.


回答1:


I had the exact same error while trying to build Tensorflow on Windows (using cuDNN 5.1). I fixed it by launching bazel from the msys2 terminal (instead of from the windows command prompt) and manually setting the BAZEL_SH environment variable before attempting to build.

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



回答2:


The following steps helped me to compile Tensorflow on Windows 10.

pacman -Syuu patch
ln -s "c:\python27\python.exe" /usr/bin/python

export BAZEL_SH=c:/tools/msys64/usr/bin/bash.exe
"C:\Documents and Settings\All Users\chocolatey\bin\bazel.exe" build --config=opt --config=win-cuda //tensorflow/tools/pip_package:build_pip_package

But after 1 hour of compilation I got another error:

C:\tools\msys64\tmp_bazel_dmitry\x1e5egqw\execroot\org_tensorflow\external\protobuf_archive\python\google\protobuf\internal\api_implementation.cc : fatal error C1083: Cannot open compiler generated file: '': Invalid argument Target //tensorflow/tools/pip_package:build_pip_package failed to build



来源:https://stackoverflow.com/questions/45962365/tensorflow-custom-compile-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!