-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_started.txt
128 lines (92 loc) · 4.51 KB
/
get_started.txt
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
----ENVIRONMENT VARIABLES----
Any system running this code needs to set up the following environment vars
LENIN_DATA_PATH=/path/to/data
BR has a preactivate hook in his virtualenvironment that has the following
in file: /Users/br/.virtualenvs/lenin/bin/preactivate
export LENIN_DATA_PATH=/var/data/lenin
For computers that might not use the virtual envs, you can just set this in
bashrc or per session.
----STFT DEPENDENCIES----
Before running the STFT functions, you must install the following dependencies
for Dan Ellis' audioread library:
mpg123 : brew install mpg123
mp3info : brew install mp3info
lame : brew install lame
----GIT SUBMODULES----
To get the submodules, after cloning the repo, from the top level, you must do:
git submodule init
git submodule update
------------------------------------------------------
**EVERYTHING BELOW IS DEPRECATED**
*note: the below paragpraph assumes we have done everything below at least once.
To get the virtualenv up and running on a new machine, assuming you have
virtualenv wrapper and create the env for the project. You can then do the
following command in the top dir of the repo to get all the python dependencies
installed in the env (assuming you have activated the env).
pip install -r requirements.txt
Our basic setup will be that pylearn2 is a git submodule that is in our repo.
I have forked it and linked it to our version of the repo, so that we can make
changes to it as we please (I have already had to adjust the shebangs on top of
the scripts so they run properly for us).
All other libraries that we want to use, or dependencies of pylearn2 will be
kept in the virtualenv.
Here are the directions to get setup.
Install virtualenv and virtualenvwrapper, using pip.
pip install virtualenv
pip install virtualenvwrapper
Go to the virtualenvwrapper homepage
(http://virtualenvwrapper.readthedocs.org/en/latest/), and follow the
directions there for setting up where your virtualenvs are kept. Mine are in
~/.virtualenvs
Create a virtualenv for lenin with
mkvirtualenv lenin
To see all your virtualenvs, use the command
workon
To use the lenin virtualenv, use the command
workon lenin
Now, let's get our dependencies in order. At any time to see what is in your
virtualenv, use
lssitepackages
While in a virtualenv any 'pip install' command will install things only for
the current virtual environment. We are going to play it safe, and say nothing
comes from anywhere but our virtualenv.
Instructions for installing scipy, numpy, etc, all found here, and given below:
http://www.lowindata.com/2013/installing-scientific-python-on-mac-os-x/
pip install numpy
brew install gfortran (YOU PROBABLY ALREADY HAVE THIS)
pip install scipy
brew install freetype
pip install matplotlib
pip install ipython
In that document, there is a cool looking GUI terminal called QT something that
lets you like look at plots in the terminal. Might be something we could be
interested in later, but requires some downloading and installing.
Now, to install the dependencies for pylearn2.
We want this in our bashrc, to point to the datasets to use with pylearn2
export PYLEARN2_DATA_PATH=/path/to/data
Mine is currently pointing to /Users/br/data/deep_learning. We probably want
to put all our datasets in here, and put all the pylearn2 datasets in there as
well. We're not going to be keeping them in the repo, obviously.
More dependencies for pylearn2:
pip install theano
pip install pyyaml
pip install pil (we probably dont really need this, but why not.)
pip install -U scikit-learn
***Not sure if we need to do this next installation step, but I have done it.
Now go into the lib/pylearn2 directory and run
python setup.py install
This installs pylearn2 into our virtualenv. I am slightly confused about what
is in the virtualenv vs what is being used from our /lib folder, but it seems
to work like this.
It should find its dependencies in our virtualenv, and everything should be
honky-dory.
I worked through this example:
http://deeplearning.net/software/pylearn2/tutorial/index.html
It will require that you download a dataset, and add another environment
variable for looking at images. I used 'open -Wn'.
If you successfully run it (which I have), we should be pretty good to go wrt
having all our dependencies in order.
I (sam) had to add the following to ~/.virtualenvs/lenin/bin/postactivate:
export $PATH=/path/to/pylearn2/pylearn2/scripts
in order to get train.py on my PATH while in a virtual env. Setting the PATH
in .bashrc wasn't enough for some reason. `workon` seems to reset the PATH.