Skip to content

Instantly share code, notes, and snippets.

@genekogan
Last active April 13, 2019 09:40
Show Gist options
  • Save genekogan/a9b043d04f96dc3bcffcef0d02fa9e3b to your computer and use it in GitHub Desktop.
Save genekogan/a9b043d04f96dc3bcffcef0d02fa9e3b to your computer and use it in GitHub Desktop.
script sets up fresh ML-in-a-box (Ubuntu 16) Paperspace template for densecap
# luarocks
sudo rm -rf ~/.cache/luarocks/
luarocks install loadcaffe
luarocks install cutorch
luarocks install cudnn
luarocks install cunn
luarocks install torch
luarocks install nn
luarocks install image
luarocks install lua-cjson
sudo apt-get -y install libpng++-dev libpng12-dev
# install cudnn
tar -xzvf ~/Downloads/cudnn-9.1-linux-x64-v7.1.tgz -C ~/Downloads
sudo cp -P ~/Downloads/cuda/include/cudnn.h /usr/local/cuda/include
sudo cp -P ~/Downloads/cuda/lib64/libcudnn* /usr/local/cuda/lib64/
sudo chmod a+r /usr/local/cuda/lib64/libcudnn*
# get cudnn (https://developer.nvidia.com/cudnn) and then (assuming cudnn 7.*) ...
git clone https://github.com/soumith/cudnn.torch.git -b R7 && cd cudnn.torch && luarocks make cudnn-scm-1.rockspec && cd .. && rm -rf cudnn.torch
# more luarocks for densecap
luarocks install https://raw.githubusercontent.com/genekogan/stnbhwd/master/stnbhwd-scm-1.rockspec
luarocks install https://raw.githubusercontent.com/jcjohnson/torch-rnn/master/torch-rnn-scm-1.rockspec
# setup densecap
git clone https://github.com/jcjohnson/densecap
cd densecap
sh scripts/download_pretrained_model.sh
# test densecap
th run_model.lua -input_image imgs/elephant.jpg
cd vis
python -m http.server # go to localhost:8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment