Skip to content

Instantly share code, notes, and snippets.

@kylemcdonald
Created February 4, 2015 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylemcdonald/870e70bfddf204e91e46 to your computer and use it in GitHub Desktop.
Save kylemcdonald/870e70bfddf204e91e46 to your computer and use it in GitHub Desktop.
Some notes for myself about installing Theano.

Virtual machine

Get Ubuntu

OS X

Make sure pip is using the right version of python (in this case I'm using homebrew):

$ echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile
$ echo export PATH='/usr/local/sbin:$PATH' >> ~/.bash_profile
$ python --version
Python 2.7.6
$ pip --version
pip 1.5.4 from /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg (python 2.7)

Install nose:

$ sudo pip install nose

Install the latest version of Theano:

$ pip install Theano --upgrade --no-deps git+git://github.com/Theano/Theano.git

Install CUDA.

Add flags for Theano (to use CUDA, or Accelerate when needed):

$ echo export CUDA_ROOT=/Developer/NVIDIA/CUDA-6.5 >> ~/.bash_profile
$ echo export THEANO_FLAGS=blas.ldflags=-lblas,device=gpu,floatX=float32 >> ~/.bash_profile

Test Theano:

$ python -c "import theano; theano.test(verbose=3)"

You should see "Using gpu device" as the beginning of the first line.

Go to energy settings and turn off automatic graphics card switching to turn your NVIDIA card on.

Grab a copy of the Deep Learning Tutorials GitHub repository:

$ git clone https://github.com/lisa-lab/DeepLearningTutorials.git

Make sure to get Pillow to replace PIL:

$ pip install Pillow

Run some code:

$ python code/logistic_sgd.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment