[Course Version 1] Updated Setup Process (Local GPU)


(t.me/fastai) #1

For those trying to get the October 2016 version of this course working

I’ve fiddled frustratingly for quite a while trying to get just the first notebook to run. So hopefully this saves some of you some time. I was going to write script and link it, but I think going though the steps yourself helps to understand how it all comes together.

  1. Install CUDA 8.0 and CUDnn 6 (I haven't tried newer, so don't know about them)
  2. Install Anaconda, latest version (doesn't matter because it lets you run older version of Python regardless)

1. For Python 2.7, Keras 1.2.2 and working with Jeremy's original Notebooks and files

  1. Create a new environment in Anaconda with Python version 2.7 and (optionally) pip as a package (just in case that later, in the environment, you ensure the right pip is being used - not the root one)
  2. Activate/Open up that environment in a terminal
  3. Install the following packages
  4. Install bleeding edge of Theano and pygpu
  5. Install blas from conda-forge
  6. Install 1.2.2 version of Keras with pip
  7. Install Jupyter in current environment (at least was necessary for me in order to get the notebook running from deep_learning environment vs root)
    • Reactivate the environment
  8. Start the notebook
conda create -n deep_learning python=2.7 pip
source activate deep_learning
conda install matplotlib pillow tensorflow pandas scikit-learn bcolz sympy h5py
conda install -c mila-udem -c mila-udem/label/pre theano pygpu
conda install -c conda-forge blas 
pip install keras==1.2.2
conda install jupyter
source deactivate
source activate deep_learning
jupyter notebook 

2. For Python 3.7, Keras 2 and Roberto Castrioto updated version of notes

  1. Referring to the following post: Link
  2. Create a new environment in Anaconda and (optionally) pip as a package (just in case that later, in the environment, you ensure the right pip is being used - not the root one)
  3. Activate/Open up that environment in a terminal
  4. Install the indicated packages
  5. Install bleeding edge of Theano and pygpu
  6. Install blas from conda-forge
  7. Install Jupyter in current environment (at least was necessary for me in order to get the notebook running from deep_learning environment vs root)
    • Reactivate the environment
  8. Start the notebook
conda create -n deep_learning pip 
source activate deep_learning
conda install matplotlib pillow tensorflow pandas scikit-learn bcolz sympy h5py keras
conda install -c mila-udem -c mila-udem/label/pre theano pygpu
conda install -c conda-forge blas 
conda install jupyter
source deactivate
source activate deep_learning
jupyter notebook 

Keras 2 / Python 3.6 notebooks
(Roberto Castrioto) #2

Just a note regarding my repo: the course v1 modules and notebooks were tested with Python 3.5 and Keras 2.0.6 on Ubuntu 16.04.


(Erin Pangilinan) #3

Thanks for posting this, what GPU are you using (using a TitanX, so then don’t have to use AWS so much right?).


(t.me/fastai) #4

Yea, this is the approach I took to setup for my local GPU. I’m using a Titan Black. You also need to setup the .theanorc and keras/keras.json files with the appropriate options.


(Brian Park) #5

I have AMD Fury Nano and I got it working using ROCm on Ubuntu 16.04 (Python2/Keras 2.x + hipTensorFlow) So far, I tested lesson1.ipynb and dogs_cats_redux.ipynb. The procedure should work for all supported AMD graphics card (Fiji, Polaris and Vega)
http://briansp2020.github.io/2017/11/05/fast_ai_ROCm/


(Eduardo) #6

Hi! I just installed the 2nd option (Python 3.7, Keras 2 and Roberto Castrioto updated version of notes) and using Roberto’s files.

I’m in a i7 4th gen, 12gb ram, mobile nVidia gForce 940m and to train the image classifier model with only 1 epoch and a batch size of 4, it takes almost an hour (more or less).

Is this normal?

Thanks!