untar_data(URL) not working on Google Colab

Im trying to download a dataset using untar_data on Google Colab.
I get an error stating ''Not a gzipped file"
I have attached screenshot.
Please help me

untar_data standardly expects gzip files only to be downloaded and extracted. In v2 you can customize this with your own extract_func

Sorry I’m a newbie to ML, colab as well as fastai. Please can you let me know how to do it.

@sanviaara
There are two steps performed in untar_data():

  1. download compressed file
  2. unzip it

My response refer to sanity check on step 1. Could you firstly verify if your downloaded compressed file contain valid dataset? Your compressed file should have a size of ~700 MB. If your compressed file turns out to have a few KB, then your downloaded file is not the dataset you want.

The downloaded file is usually located inside ~/.fastai/data (e.g. ~/.fastai/data/fruits.tgz’). You can find it out by the following command:

In Linux Command:
$ ls ~/.fastai/data
In Colab:
!ls ~/.fastai/data

The command would list all files inside the target directory. You can identify your downloaded file by the creation date and time.

To check the compressed file and its size:

In Linux Command:
$ ls -lh ~/.fastai/data/fruits.tgz 
In Colab:
!ls -lh ~/.fastai/data/fruits.tgz

Hope it helps
(Note Colab command has a “!” at the beginning because I assume you are executing the command inside the colab jupyter notebook.)