Dmitry.AI

How did I install TensorFlow 13.1 from source on Ubuntu 18.04?

ubuntu
unix
tensorflow-installation
tensorflow
(Dmitry Fedyuk) #1

Step 1

apt install python3-dev python3-pip

Step 2

pip3 install -U pip six numpy wheel setuptools mock
pip3 install -U keras_applications==1.0.7 --no-deps
pip3 install -U keras_preprocessing==1.0.9 --no-deps

Step 3

How did I install Basel 0.21.0 for TensorFlow 1.13.1 compilation on Ubuntu 18.04?

Step 4

aptitude install git

Step 5

cd /usr/local
git clone https://github.com/tensorflow/tensorflow.git
cd tensorflow
git reset --hard v1.13.1

Step 6

./configure

The script asked a dozen of questions to me.
Among my answers:
Python path: /usr/bin/python3
cuDNN path: /usr/lib/x86_64-linux-gnu

Step 7

bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

de84282596504e0f2ccbac786c41fa065329495d

The build produced the ./bazel-bin/tensorflow/tools/pip_package/build_pip_package file.

Step 8

./bazel-bin/tensorflow/tools/pip_package/build_pip_package --nightly_flag /tmp/tensorflow_pkg

The build produced the /tmp/tensorflow_pkg/tf_nightly-1.13.1-cp36-cp36m-linux_x86_64.whl file

Step 9

pip install /tmp/tensorflow_pkg/tf_nightly-1.13.1-cp36-cp36m-linux_x86_64.whl

Step 10

Testing:

cd
python3 -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))"

02

tensorflow.org/install/source#gpu_support

tensorflow.org/install/source