Skip to content

Instantly share code, notes, and snippets.

@erikbern
Last active October 19, 2016 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save erikbern/850f3750518347e3901b to your computer and use it in GitHub Desktop.
Save erikbern/850f3750518347e3901b to your computer and use it in GitHub Desktop.
Install TensorFlow on EC2
# Start from ami-763a311e
# Install various packages
sudo apt-get update
sudo apt-get upgrade -y # choose “install package maintainers version”
sudo apt-get install -y build-essential python-pip python-dev git python-numpy swig python-dev default-jdk zip zlib1g-dev
# Install Bazel
git clone https://github.com/bazelbuild/bazel.git
cd bazel
git checkout tags/0.1.0
./compile.sh
sudo cp output/bazel /usr/bin
cd
# Install TensorFlow
rm -rf /tmp # for some reason /tmp is full of crap by now
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64"
export CUDA_HOME=/usr/local/cuda
git clone --recurse-submodules https://github.com/tensorflow/tensorflow
cd tensorflow
wget "https://gist.githubusercontent.com/infojunkie/cb6d1a4e8bf674c6e38e/raw/5e01e5b2b1f7afd3def83810f8373fbcf6e47e02/cuda_30.patch"
git apply cuda_30.patch
./configure
bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer
cd tensorflow/tensorflow/models/image/mnist
python convolutional.py
# (NOT DONE YET)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment