forked from Sudzz/deep-learning-vm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
87 lines (71 loc) · 3.15 KB
/
Copy pathsetup.sh
File metadata and controls
87 lines (71 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
################################################
# Provisions the Deep Learning Virtual Machine
#
# Credits :
# http://ermaker.github.io/blog/2015/09/08/get-started-with-keras-for-beginners.html
# https://github.com/ericwooley/apt-fast-vagrant-install (for apt-fast)
# https://gist.github.com/malev/2d2d76b1662e13acbbca (for miniconda)
# https://gist.github.com/davemkirk/90140b1edde8d18c8b83 (for IPython notebooks)
################################################
function mssg {
now=$(date +"%T")
echo "[$now] $1"
shift
}
mssg "Provisioning the Deep Learning Virtual Machine ..."
mssg "Updating the package index files. Usually takes ~ 6 minutes, depending on the speed of your network ..."
apt-get -y update >/dev/null 2>&1
################################################
# apt-fast
mssg "Installing apt-fast to try speed things up ..."
apt-get install -y aria2 --no-install-recommends >/dev/null 2>&1
filetowget=apt-fast
if [[ ! -f $filetowget ]]; then
wget https://raw.githubusercontent.com/ilikenwf/apt-fast/master/apt-fast >/dev/null 2>&1
cp apt-fast /usr/bin/
chmod +x /usr/bin/apt-fast
fi
filetowget=apt-fast.conf
if [[ ! -f $filetowget ]]; then
wget https://raw.githubusercontent.com/ilikenwf/apt-fast/master/apt-fast.conf >/dev/null 2>&1
cp apt-fast.conf /etc
fi
mssg "Installing pip ..."
apt-fast -y install python-pip >/dev/null 2>&1
################################################
mssg "Downloading & Installing Anaconda ..."
anaconda=Anaconda3-4.2.0-Linux-x86_64.sh
if [[ ! -f $anaconda ]]; then
wget --quiet https://repo.continuum.io/archive/$anaconda
chmod +x $anaconda
./$anaconda -b -p /home/vagrant/anaconda
echo 'export PATH="/home/vagrant/anaconda/bin:$PATH"' >> /home/vagrant/.bashrc
source /home/vagrant/.bashrc
chown -R vagrant:vagrant /home/vagrant/anaconda
/home/vagrant/anaconda/bin/conda install conda-build anaconda-client anaconda-build -y -q
fi
################################################
/home/vagrant/anaconda/bin/conda install "scikit-learn==0.18" -y -q
/home/vagrant/anaconda/bin/conda install "graphviz=2.38.0" -y -q
################################################
# Tensorflow, Keras
mssg "Installing Tensorflow dependencies"
apt-fast install -y python3-numpy python3-scipy python3-dev python3-pip python3-nose g++ libopenblas-dev git >/dev/null 2>&1
/home/vagrant/anaconda/bin/pip install nose
/home/vagrant/anaconda/bin/pip install nose_parameterized
mssg "Installing Tensorflow"
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.3.0-cp35-cp35m-linux_x86_64.whl
/home/vagrant/anaconda/bin/pip install $TF_BINARY_URL >/dev/null 2>&1
mssg "Installing Keras"
/home/vagrant/anaconda/bin/conda install -c conda-forge keras=2.0.6
################################################
# Other Python packages
/home/vagrant/anaconda/bin/pip install --verbose -r /home/vagrant/requirements.txt
################################################
mssg "Clone Huma tutorial files from git"
git clone https://github.com/mmeyer/huma-tutorial.git /home/vagrant/huma-tutorial/notebooks
echo ""
mssg "List of installed packages"
/home/vagrant/anaconda/bin/pip list
mssg "Done!"