FastAi + Kaggle/External Datasets

Hi I have tried to download external / kaggle daasets to paperspace using untar_data but to no avail would anyone happen to have sample code i could borrow ?

Never tried paperspace before. Why don’t you try google colab ? There is an option to switch to GPU too within colab.

Ill give collab a go, could you share me a sample code to use there if possible ? Id love to get off on a good start with colab ahahah

Here you go.

You can turn on gpu by clicking on runtime -> change runtime type -> GPU

hi I meant code which does the downloading of data from an external dataset.

For that, you can either download your data to google drive and import into google colab.

Here’s the link for importing data from google drive to colab

The other way is to use curl wget command. You can look for it on google.

Otherwise you can also use kaggle api.
Here is colab notebook for integrating kaggle api

For the benefit of other people who may have the issue

here is an example of using colab+kaggle to download data:

!pip install -Uqq fastbook

!pip3 install fastai

import fastbook

from fastbook import *


!pip install kaggle

!mkdir .kaggle

from google.colab import files


!ls -lha kaggle.json

!pip install -q kaggle

!mkdir -p ~/.kaggle

!cp kaggle.json ~/.kaggle/

!chmod 600 ~/.kaggle/kaggle.json

!kaggle datasets download -d AlifRahman/chestxraydataset

1 Like