Installing Chainer for Your Deep Learning Projects
I think many people use TensorFlow for deep learning projects and I was thinking about it as well.
However, I changed my mind somehow and decided to use Chainer.
Chainer is developed by Japanese company called Preferred Networks (PFN).
How is the performance?
Well, according to them, image classification training using ImageNet data set took the least time compared with other frameworks like MXNet, CNTK, TensorFlow.
I think there are pros and cons between the frameworks but just decided to use it as I am also Japanese Fan :)
I will go through how to setup Chainer environment using Windows.
However, it applies to Linux as well since I am actually using Linux on top of virtual machine.
It is so easy so hope people try it and start using Chainer!
Setup
As I mentioned before, I am using Windows.
If you have Linux machine, you can skip step 1-3 and just install Chainer.
1. Install VirtualBox
First I installed VirtualBox which is a virtual machine.
You can install it from VirtualBox website.
Download VirtualBox and install it.
*** I downloaded VirtualBox 5.2
2. Download Ubuntu image
Next is to download Ubuntu image and this will be your Linux environment for deep learning.
Download the image from Ubuntu website.
***I downloaded Ubuntu18.04 64-bit
3. Add Ubuntu to VirtualBox
Click [New] to create a virtual machine and select [Expert Mode] if it is not displayed as [Expert Mode].
In "Name and operation system", follow this.
In "Name and operation system", follow this.
Name: whatever you want to name this virtual machine
Type: Linux
Version: Ubuntu (64-bit)
Keep other areas as is and click [Create].
Click the folder icon in "File location" and select any location that you want to keep VirtualBox system files for this virtual machine. (Log and others)
Set "File size" to 16GB or 32GB.
Click [Create] and this will add new virtual machine to the left side of your VirtualBox main screen.
3. Install Ubuntu
Select virtual machine name that you created and click "Start".
It will ask for Ubuntu image and choose the Ubuntu image that you downloaded.
After this, it is just normal Ubuntu installation process and you can follow the instructions.
4. Install Chainer
Okay, now we can install Chainer and here is how.
$ sudo apt-get install python-pip
$ sudo pip install --upgrade pip
$ sudo pip install chainer==3.2.0
$ sudo apt-get install python-matplotlib
$ sudo apt-get install graphviz
$ sudo apt-get install python-tk
Test
To test If you have successfully installed Chainer, we can use Chainer official sample program.
$ wget https://github.com/chainer/chainer/archive/v3.2.0.tar.gz
$ tar xzf v3.2.0.tar.gz
$ tar xzf v3.2.0.tar.gz
$ cd chainer-3.2.0/examples/mnist
$ python train_mnist.py
after this, you will see test results in the terminal.
Now you can start using Chainer!
You can find lots more in Chainer website