summary: “Python decorators enable to dynamically alter the functionality of a function/method/class.”
github-link: na
—
In this post, I detail how to install/upgrade Tensorflow (TF) to a newest version. The installation is for Python3.5 with NVidia GPU support for Graphics computing. The installation is made from the source because it enables the build to be specific to the machine architecture. It also enriches TensoFlow with a better system compatibility, and then allowing higher performance.
To update/install TF, one needs to perform the following steps:
Steps
Details
1
Remove tensorflow and protobuf (if previously installed)
2
Download TF source
3
Install Bazel
4
Run TF Configuration script
5
Build TF whl package with Bazel
6
Install TF whl
7
Check that TF uses GPU
MACHINE SPECS
Below are the details of my machine: a Ubuntu 16.04 LTS Desktop with a 16Gb NVidia TitanX card, dedicated to computing only (no graphic work), 32 Gb of RAM.
STEP1: REMOVE PREVIOUS INSTALL OF PROTOBUF/TF
STEP2: DOWNLOAD TF SOURCE
link
To clone the latest TensorFlow repository, issue the following command:
To install the latest version of TF, skip the last line (git checkout …).
A Directory tensorflow is then created.
STEP3: INSTALL BAZEL
The updated list of releases are available here.
Note that we will not be installing the latest version of Bazel, but the Release 0.5.4 (2017-08-25). Indeed, with the newest versions of Bazel, there is an error when building the TF library.
First, we need to download the sh file, and then install bazel:
STEP4: RUN TF CONFIGURATION SCRIPT
Now, we need to configure the installation: the flags of the configuration are of great importance because they determine how well and compatible the TensorFlow will be installed!! At first we have to go to the TensorFlow root:
You should see a screen as shown below, and a series of [Y/N] flags to configure the install.
Before starting to answer the flags, make sure you know the version of Python you want TF to be build for:
Then run the configure script as follows:
STEP5: BUILD TF .WHL PACKAGE WITH BAZEL
The bazel build command builds a script named build_pip_package. Running the following script build a .whl file within the ~/tensorflow_package directory:
STEP6: INSTALL TF WHL
STEP7: CONFIRM GPU USAGE BY TF
Before running any of the steps below, make sure you are not anymore in the tensorflow folder or in a folder where tensorflow is a direct child folder.