Skip to content

Instantly share code, notes, and snippets.

@sio2boss
Last active April 19, 2016 10:10
Show Gist options
  • Save sio2boss/1966fac2f66122e24d2e to your computer and use it in GitHub Desktop.
Save sio2boss/1966fac2f66122e24d2e to your computer and use it in GitHub Desktop.
Torch7 And Caffe
#! /bin/sh
# Need to install CUDA first
# Need to update with cuDNN procedure
# Dependencies
sudo apt-get install -y libatlas-base-dev libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler cmake git curl clang python-pip python-dev build-essential
sudo pip install --upgrade pip
# Install Torch
if [ -e /usr/local/bin/th ]; then
curl -s https://raw.githubusercontent.com/torch/ezinstall/master/clean-old.sh | bash
fi
curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-all | bash
# Install Caffe
git clone --depth=1 https://github.com/BVLC/caffe.git
cd python
for req in $(cat requirements.txt); do sudo pip install $req; done
cd ..
mkdir -p build
#curl -L https://gist.githubusercontent.com/sio2boss/55d116e1f8bf0e73f0d6/raw/5a9e7c10f41bbddb1787a1fe3fc5a2784c5fa024/caffe-cudnn.patch | patch -p1
cd build
cmake -DCMAKE_CXX_COMPILER=clang++ ..
make
make runtest
# Run alexnet
cd ..
build/tools/caffe time --model=models/bvlc_alexnet/deploy.prototxt --gpu=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment