Skip to content

Instantly share code, notes, and snippets.

@bazadactyl
Created December 13, 2017 22:41
Show Gist options
  • Save bazadactyl/58d937211bb754829f1d078c96cdf469 to your computer and use it in GitHub Desktop.
Save bazadactyl/58d937211bb754829f1d078c96cdf469 to your computer and use it in GitHub Desktop.
Installing TensorFlow 1.4 (CPU only) from source on Ubuntu 16.04
###################################################################
## Compile and install TensorFlow 1.4 (CPU only) on Ubuntu 16.04 ##
###################################################################
# Install Bazel
sudo apt-get install openjdk-8-jdk -y
echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
sudo apt-get update -y && sudo apt-get install bazel -y
sudo apt-get upgrade bazel -y
sudo apt-get install python3-numpy python3-dev python3-pip python3-wheel -y
# Download TensorFlow source
cd ~
git clone https://github.com/tensorflow/tensorflow
cd tensorflow
git checkout r1.4
# Build TensorFlow
./configure
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
sudo pip install /tmp/tensorflow_pkg/*.whl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment