Skip to content

Instantly share code, notes, and snippets.

@genekogan
Last active April 13, 2019 09:40
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 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