Last active
August 9, 2017 08:52
-
-
Save csarron/a265280010faeecae3e8c204c5749a67 to your computer and use it in GitHub Desktop.
Install TensorFlow 1.2 Python 3 On Jetson TX 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#install dependencies | |
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install oracle-java8-installer -y | |
sudo apt-get install zip unzip autoconf automake libtool curl zlib1g-dev maven -y | |
sudo apt install python3-numpy python3-dev python3-pip python3-wheel | |
# install bazel | |
bazel_version=0.5.1 | |
wget https://github.com/bazelbuild/bazel/releases/download/$bazel_version/bazel-$bazel_version-dist.zip | |
unzip bazel-$bazel_version-dist.zip -d bazel-dist | |
sudo chmod -R ug+rwx bazel-dist | |
cd bazel-dist | |
./compile.sh | |
sudo cp output/bazel /usr/local/bin | |
#build tensorflow | |
git clone --recursive https://github.com/tensorflow/tensorflow.git | |
cd tensorflow | |
git checkout v1.2.0 | |
export PYTHON_BIN_PATH=$(which python3) | |
# No Google Cloud Platform support | |
export TF_NEED_GCP=0 | |
# No Hadoop file system support | |
export TF_NEED_HDFS=0 | |
# Use CUDA | |
export TF_NEED_CUDA=1 | |
# Setup gcc ; just use the default | |
export GCC_HOST_COMPILER_PATH=$(which gcc) | |
# TF CUDA Version | |
export TF_CUDA_VERSION=8.0 | |
# CUDA path | |
export CUDA_TOOLKIT_PATH=/usr/local/cuda | |
# cuDNN | |
export TF_CUDNN_VERSION=5.1.10 | |
export CUDNN_INSTALL_PATH=/usr/lib/aarch64-linux-gnu | |
# CUDA compute capability | |
export TF_CUDA_COMPUTE_CAPABILITIES=6.2 | |
export CC_OPT_FLAGS=-march=native | |
export TF_NEED_JEMALLOC=1 | |
export TF_NEED_OPENCL=0 | |
export TF_ENABLE_XLA=1 | |
yes "" | ./configure | |
bazel build -c opt --verbose_failures --config=cuda //tensorflow/tools/pip_package:build_pip_package | |
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg | |
mv /tmp/tensorflow_pkg/tensorflow-1.2.0*-linux_aarch64.whl . | |
echo 'all finished' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Used this to get tensorflow 1.2.1 on python 2.7 with a few changes, however this also required the patch to worspace.bzl to update the "eigen_archive" package.