To get my website (re)started I’ve decided to provide a tutorial on how to get started with deep learning based image classification. This post will get help you with the fundamental steps to setup your prerequisites such as your graphics driver and CUDA.
If you’re here, you likely know what image classification is, but just in case you don’t: Image classification is the process of detecting objects within an image. The computer may have never seen these objects before, but may have seen ones like these objects. So, if you train an algorithm to detect people, dogs, and bikes, your software should be able to detect any people, dogs, and bikes in an image you feed to it; even if it has never seen that specific image before. (The key word here is should, and I’ll discuss more about this once we get in to analyzing the results.)
- Intel Core i7 6000 series CPU
- Nvidia GTX 1000 series GPU
- Fresh Ubuntu 16.04 LTS (xenial) install
If you have an already installed Ubuntu system some of your steps may vary, but hopefully this will get you most of the way there.
Installing Nvidia Drivers
While you can install Nvidia graphics drivers via their shell script / package, I HIGHLY RECOMMEND you use the CUDA installer package provided by Nvidia. This will make your life a lot easier on multiple fronts as you won’t have to deal with blacklisting the nouveau driver, installing CUDA separately, etc.
Go to Nvidia’s CUDA download page and choose your appropriate architecture. In my case that was Linux ⇒ x86_64 ⇒ Ubuntu ⇒ 16.04 ⇒ deb (network).
The instructions should pop up pretty clearly on their site, but in short: 1. Download the deb package 2. Run the following commands:
sudo dpkg -i cuda-repo-\*.deb sudo apt-get update sudo apt-get install -y cuda
sudo rebootto use your new drivers
If you’re familiar with docker, I have an image or two that may be useful to you on Docker hub. I’ll call these out in the appropriate posts, but you can find the bulk of them at my Docker Hub page.
If you’re not familiar with Docker, I’ll provide installation and compilation instruction within each of the applicable posts. (Don’t be surprised if I largely copy paste the instructions from my Dockerfile though!)
Now you should have the basic prerequisites installed and ready to go. From here I’ll talk about a few of the image classification methods like Single Shot Multibox Detector (SSD), You Only Look Once (YOLO), and others.