Skip to content

Instantly share code, notes, and snippets.

@tingletech
Created December 14, 2016 03:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tingletech/2be5c5301ec011f0d3357b69a1a6a358 to your computer and use it in GitHub Desktop.
Save tingletech/2be5c5301ec011f0d3357b69a1a6a358 to your computer and use it in GitHub Desktop.
Notes for setting up to follow https://github.com/tensorflow/models/tree/master/im2txt on a generic ubuntu 14x AMI

Ubuntu/Linux 64-bit, GPU enabled, Python 2.7 Requires CUDA toolkit 8.0 and CuDNN v5.1

Install CUDA 8.0

wget "http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_8.0.44-1_amd64.deb"
sudo dpkg -i cuda-repo-ubuntu1404_8.0.44-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda

Install CuDNN 5.1 (need to log in to nvidia developer account) to download, then scp to the server.

tar zxf ~/cudnn-8.0-linux-x64-v5.1.tgz 
cd cudnn/
sudo cp -P cuda/include/cudnn.h /usr/local/cuda/include
sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*

install other nvidia stuff

sudo apt-get install linux-image-extra-virtual
sudo apt-get install nvidia-361

install tensorflow r0.12

export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.0rc1-cp27-none-linux_x86_64.whl
sudo apt-get install python-dev
sudo pip install --ignore-installed --upgrade $TF_BINARY_URL

set environmental variables (add this to .bash_profile as well)

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
export CUDA_HOME=/usr/local/cuda

test tensorflow install

python -m tensorflow.models.image.mnist.convolutional

install inception checkpoint

INCEPTION_DIR="${HOME}/im2txt/data"
mkdir -p ${INCEPTION_DIR}
wget "http://download.tensorflow.org/models/inception_v3_2016_08_28.tar.gz"
tar -xvf "inception_v3_2016_08_28.tar.gz" -C ${INCEPTION_DIR}
rm "inception_v3_2016_08_28.tar.gz"

install bazel (like a google version of make)

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
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 && sudo apt-get install bazel

install nltk

sudo pip install -U nltk
sudo python -m nltk.downloader -d /usr/local/share/nltk_data all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment