0
点赞
收藏
分享

微信扫一扫

How to compile tensorflow on Windows?

是波波呀 2022-03-11 阅读 78

1.Install Bazel firstly

If you haven't install bazel on your Windows, then install it. You can reference this article:

Installing Bazel on Windows - Bazel 4.0.0

2 COMPATIBLE SOLUTION:

Execute the below commands in Terminal (Linux/MacOS) or in Command Prompt (Windows) to install Tensorflow 2.0 using Bazel:

(The following prompt is from: x86 - How to compile Tensorflow with SSE4.2 and AVX instructions? - Stack Overflow)

git clone https://github.com/tensorflow/tensorflow.git
cd tensorflow

#The repo defaults to the master development branch. You can also checkout a release branch to build:
git checkout r2.0

#Configure the Build => Use the Below line for Windows Machine
python ./configure.py

#Configure the Build => Use the Below line for Linux/MacOS Machine
./configure
#This script prompts you for the location of TensorFlow dependencies and asks for additional build configuration options.

#Build Tensorflow package

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

#GPU support
bazel build --config=opt --config=cuda --define=no_tensorflow_py_deps=true //tensorflow/tools/pip_package:build_pip_package
举报

相关推荐

0 条评论