...
TensorFlow uses Bazel build system so the first step is to compile Bazel for windows on arm.
Build Bazel
Bazel can be either built from scratch or built using Bazel. Building using another Bazel seems to be the easiest option and we have two options for that.
...
The steps given below are similar for above both setups.
Checkout Bazel with windows on arm support
Please check out the following repository for Bazel 4.2.1 source code with win/arm64 support
...
Or apply https://github.com/nsait-linaro/bazel/commit/bcfdf9a891900c3123203b6ee7e8c514462b75c6 to Bazel repository
Download Bazel (x64)
TensorFlow compiles only with Bazel version 4.2.1 or below. To build WoA Bazel 4.2.1 it is recommended to use x64 Bazel 4.2.1.
...
Code Block |
---|
$env:BAZEL_SH="C:\msys64\usr\bin\bash.exe" $env:BAZEL_VC="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC" $env:JAVA_HOME="C:\Users\niysai01\Downloads\zulu17.30.15-ca-jdk17.0.1-win_aarch64\zulu17.30.15-ca-jdk17.0.1-win_aarch64\" |
Compile Bazel (Arm64)
And now you are all set to build Bazel. Please use the following command to build
...
You can add bazel.exe
to your PATH and will use it for the TensorFlow build.
Build TensorFlow
Checkout TensorFlow
See instructions here: https://www.tensorflow.org/install/source
Apply TensorFlow patch to add windows on arm support
Apply the following patch to your TensorFlow repository.
...
Now run python configure.py
and default options should work.
Compile TensorFlow
Please use the following command to build TensorFlow
...
This will generate the binary python wheel which can be installed with pip install <generated_wheel>.whl
Running TensorFlow Tests
Create a py_test_dir in the TensorFlow directory and add a symlink
...
Code Block |
---|
C:\msys64\usr\bin\bash.exe ..\run_test.sh |
TensorFlow Test Results
TensorFlow seems to be working fine with examples from https://www.tensorflow.org/tutorials/quickstart/beginner
...
Number of tests | |
---|---|
Total | 894 |
Pass | 879 |
Fail | 15 |
Known Issues
There are a few known issues with the TensorFlow build.
...