Let’s run Neural Network Libraries on Colab!

Friday, August 23, 2019


Posted by shin

Google Colab is an environment provided by Google, where you can easily run deep learning experiments. In other words, it’s a freely available Jupyter notebook environment running completely on clouds, without having to set up environments.

In this post、we’d like to introduce how to run Neural Network Libraries’ tutorials on Google Colab.

When you access Google Colab, you can select which notebook to use.

Please select GITHUB, and search for ‘sony/nnabla’ in the search box, and then .ipynb file from  Neural Network Libraries’s GitHub repositor will appear. For now, let’s try ‘tutorial/by_examples.ipynb.’

Now, the Jupyter Notebook will open, but it is not ready to run yet. We need to change the setting a bit.

First, in order to use GPU, select ‘Runtime’ and ‘Change runtime type.’


Select ‘GPU’ from ‘Hardware accelerator.’


Now, click ‘Connect.’

We have now connected to GPU backend.


We’re almost there. Now, click ‘+Code,’


!pip install nnabla-ext-cuda100

to the code, and run it by CTRL+ENTER. When asked whether to reset runtime environments, select OK.


Likewise, run

!git clone https://github.com/sony/nnabla.git

%cd nnabla/tutorial



We are ready now!

You can either run the code line by line and check its behavior, or select ‘Runtime’ → ‘Run after’ and check the results.

Other tutorials can be run in the same way.

Enjoy the world of Neural Network Libraries!