Category Archives: Installation

Download Data from Kaggle

In this tutorial, I will guide you to download kaggle dataset from your python notebook directly or from your command shell(to download from command shell remove the exclamation mark(!) from start). Here are the necessary steps to follow:

  1.  Sign in to your kaggle account and enter into the competition by accepting its rules for which you need data to be downloaded.
  2. Firstly, install kaggle cli using pip by writing following command into python notebook:
    !pip install kaggle-cli
  3. If you get any error while executing the previous step try the following command instead:
    !pip install kaggle-cli –upgrade
  4. Then configure your kaggle account with your username, password and competition name from which data to be downloaded. Your username and password should be inside inverted comma. The command is as follows:
    !kg config -u ‘username’ -p ‘password’ -c competitonName
    competition name for downloading dataset can be extracted from competition’s URL e.g if competition’s URL is https://www.kaggle.com/c/imagenet-object-detection-challenge then competition name would be imagenet-object-detection-challenge.
  5. And finally, write following command to download data:
    !kg download
  6. Then you can extract dataset into the particular folder by using the following command:
    !unzip –q filename.zip -d folderName
  7. You can also download particular data file from kaggle using following command:
    !kg download -u ‘username’ -p ‘password’ -c competitonName -f fileName

Enjoy!!!

Connecting Raspberry pi to proxy server

In this tutorial, I am going to tell you how to connect raspberry pi to the proxy server.

As most of the colleges have internet connection through local ethernet having its own proxy settings so for downloading packages on raspi you have to set up local proxy settings.

Here are the simple steps for connecting raspi to the proxy server.

  1. Open Root Terminal (Ctrl+Alt+T) and then type:

    This command creates a file named 10proxy and then add proxy settings to this file by typing:

    and save it. You need to add in the exact format as written above (do not leave any semicolon or space).
  2. Again in Root Terminal  type:

    then add proxy settings to this file by typing:

    and save it. If you want to know more about environment variables follow this link https://help.ubuntu.com/community/EnvironmentVariables
  3. Again in Root Terminal type:

    This opens bash file scroll to the end of the file and type:

    and save it. If you want to know more about .bashrc follow this link https://askubuntu.com/questions/540683/what-is-a-bashrc-file-and-what-does-it-do
  4. At last in Root Terminal type
  5. In order to download the file using sudo, update sudoers. First, open sudoers using

    Then add the following line so that sudo is able to use the above environment variables

    Reboot pi for the changes to work.
  6. Then run the following command in the Root Terminal for checking if the internet is working

Hope this helps. Enjoy!!!

Free GPU for fast.ai on Google Colab

In this tutorial, I will guide you to use google colab for fast.ai lessons.

Google colab is a tool which provides free GPU machine continuously for 12 hours. Even you can reconnect to a different GPU machine after 12 hours.

Here are the simple steps for running fast.ai Notebooks on google colab.

  1. Download fast.ai lesson notebooks. from https://github.com/fastai/fastai/tree/master/courses/dl1
  2. Login to your Google(Gmail) account in a browser.
  3. Go to colaboratory at URL https://research.google.com/colaboratory/unregistered.html
  4. A pop-up window will appear, close that window.
  5. Upload a new Notebook from your downloaded notebook files on colab (go to File ->Upload Notebook ) whichever lesson you want to work on.
  6. Now change your runtime machine to GPU machine and choose the type of python (Python 2 or Python 3) you are going to use by clicking on (runtime -> change runtime type).
  7. You can check if GPU running or not by writing the following code:

    it should come up with output ‘/device:GPU:0′ 

Now install the following libraries in your notebook by inserting code cells( Insert -> code cell ):

  1. Install pytorch using
  2. Install fast.ai using
  3. Install libSM using

Download dataset using bash commands as an example of dogs vs cats dataset

Now you are ready to use fast.ai on google colab.

Enjoy!!!