This is the first post in the series of two posts describing how to build TensorFlow from source on Windows.

This being my very first article on medium, I am pretty enthusiastic to share my own experience of building and installing TensorFlow version 1.14.0 on Windows 10 from source code. In this article (consisting of a series of two posts), I will try to ensure that all bits-and-pieces of the complete process are included (because I struggled quite a lot in solving small issues here and there!) so that you can go through the entire process smoothly.

First things first, let’s discuss in brief why do we need to build TensorFlow from source when we can simply pip-install it.

Why build from source in the first place?

Just as a side-note, I found out about this “build TensorFlow from source” thingy when I was using the pip-installed TensorFlow v1.14.0 and during the execution of some program, the following message showed up-

Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

After this, I dug deeper and found out about this “build from source” method.

So basically, there are two standard ways to install any python package (such as TensorFlow). The first one is the most basic one and it is the one which is generally used which is by using the pip command. This command uses the **pre-built binary wheel **to install the package. This binary is built to be compatible widely across different systems and hence doesn’t use the CPU extensions as these extensions’ compatibility may vary from CPU to CPU. The CPU extensions such as SSE4.1, SSE4.2, AVX, AVX2, FMA, etc. are very useful and significantly speed-up linear algebra computations. Thus, essentially the second method exploits the usage of these CPU extensions as we ourselves build our own binary wheel file (specific to our system such that it uses the CPU extensions supported by our system) and then install the package using this “own-made” binary, and this is what is called the build from source method which we will cover in this article.

This article deals with:

  • Building** Tensorflow version 1.14.0**
  • on** Windows 10 x64-based processor**
  • using** Python 3.7**
  • configured for** CPU only setup **(this article doesn’t involve building TensorFlow for GPU)

#tensorflow #windows-10 #python #build-from-source #bazel

How to Build and Install TensorFlow for CPU from source code on Windows (Part 1)
12.45 GEEK