Wednesday, April 3, 2019

FastAI and Keras install on Ubuntu 18.04 with Nvidia

Jeremy Howard's FastAI MOOC is a bravura exercise in on-line teaching. Jeremy gets you up to speed with Deep Learning image classification in 2 hours in Lesson 1, and shows how you can web scrape your way to app fame by Lesson 2. 

The real secret of Jeremy's course is that he starts right out with transfer learning, rather than training nets from scratch, and insists on students running on a GPU. Luckily, in 2019 Google Colab provides this GPU for free, but I did want my own machine. 

Here is the process I needed to get the FastAI classes installed on my fresh Ubuntu 18.04 with RTX 2060. 

First for the RTX 2060  Ubuntu drivers, I (made a mistake and installed the beta ppa, but then) followed the instructions here and typed 

$ sudo ubuntu-drivers autoinstall
That was it! Done!

Then I used apt-get to install the Anaconda Python environment tool, and used Anaconda to grab FastaAI with all the Nvidia drivers. Here is the advice on how to do it which I got in the FastAI forums:
$ conda create --name testme -c pytorch -c fastai fastai
$ conda activate testme
I also had to get Jupyter Notebook via Anaconda. 

By the way if you prefer Keras to FastAI, here is the command you need:

$ conda create --name tf_gpu tensorflow-gpu

No comments:

Post a Comment

Hey, let me know what you think of my blog, and what material I should add!