Skip to content

Instantly share code, notes, and snippets.

@machinehead
Last active February 26, 2017 14:15
Show Gist options
  • Save machinehead/8db9ed7b7b8616d8696759ed37d71376 to your computer and use it in GitHub Desktop.
Save machinehead/8db9ed7b7b8616d8696759ed37d71376 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -uxe
export LC_CTYPE=en_US.UTF-8
cd ~
wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64-deb
sudo dpkg -i cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64-deb
sudo apt-get update
sudo apt-get -y install cuda python2.7-dev libhdf5-dev mc htop virtualenv
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch
bash install-deps
./install.sh
source ~/.bashrc
luarocks install torch
luarocks install nn
luarocks install optim
luarocks install lua-cjson
git clone https://github.com/deepmind/torch-hdf5 ~/torch-hdf5
cd ~/torch-hdf5
luarocks make hdf5-0-0.rockspec
luarocks install cutorch
luarocks install cunn
git clone https://github.com/jcjohnson/torch-rnn.git
cd torch-rnn
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
python scripts/preprocess.py --input_txt data/tiny-shakespeare.txt --output_h5 tiny-shakespeare.h5 --output_json tiny-shakespeare.json
th train.lua -input_h5 tiny-shakespeare.h5 -input_json tiny-shakespeare.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment