Difference between revisions of "Compiling Tensorflow from sources"
Jump to navigation
Jump to search
Line 14: | Line 14: | ||
Then, download and install Bazel: | Then, download and install Bazel: | ||
+ | wget https://github.com/bazelbuild/bazel/releases/download/0.15.2/bazel-0.15.2-linux-x86_64.deb | ||
+ | apt-get install ./bazel-0.15.2-linux-x86_64.deb | ||
Then, download and extract Tensorflow source code: | Then, download and extract Tensorflow source code: | ||
Line 32: | Line 34: | ||
during the compilation process, it may show many warnings. | during the compilation process, it may show many warnings. | ||
+ | |||
+ | The entire process will take about 2-3 hours. |
Revision as of 13:49, 20 July 2018
Compiling Tensorflow from sources
First of all, we need a clean Ubuntu VM. I installed an Ubuntu 18.04LTS x86_64 with 80GB HD, 4 CPUs and 4GB of RAM.
After installing and setting the network, update:
apt-get update apt-get upgrade
Then install basic tools:
apt-get install python3-numpy python3-dev python3-pip python3-wheel
Then, download and install Bazel:
wget https://github.com/bazelbuild/bazel/releases/download/0.15.2/bazel-0.15.2-linux-x86_64.deb apt-get install ./bazel-0.15.2-linux-x86_64.deb
Then, download and extract Tensorflow source code:
wget https://github.com/tensorflow/tensorflow/archive/v1.9.0.tar.gz tar xvfz v1.9.0.tar.gz cd tensorflow-1.9.0
and configure it:
./configure
During the configuration, specify the python location (in this case, /usr/bin/python3) and just accept the defaults.
After that, it's time to compile:
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
during the compilation process, it may show many warnings.
The entire process will take about 2-3 hours.