0

I'm trying to download the dataset from this Kaggle competition:

https://www.kaggle.com/c/pku-autonomous-driving/overview

into Google Colab.

I've downloaded my .json file from Kaggle and used the following commands:

# Upload data to Google Colab
import os
os.environ['KAGGLE_USERNAME'] = "xxxxxx" # username from the json file
os.environ['KAGGLE_KEY'] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx" # key from the json file
!kaggle competitions download -c pku-autonomous-driving # api copied from kaggle

But this downloads all the files into Google Collab without making any folders in the process and saves everything alltogether, eventually after a few minutes it fails because there're too many requests to download.

My question is: How can I download it as a .zip file, or any other way to download it into Google Collab? (I did search before asking here, but didn't find a great solution)?

I also tried clicking the download button near the Competition API, and copied the link, and tried with !wget ("link address") but this also fails and doesn't start to download the files.

I have other options I can try like uploading it into my Google Drive and then mounting it, but I do want to know if there's a way around it.

questionto42
  • 7,175
  • 4
  • 57
  • 90
Ilan Aizelman
  • 49
  • 1
  • 7
  • Does this answer your question? [Download file from Kaggle to Google Colab](https://stackoverflow.com/questions/62673074/download-file-from-kaggle-to-google-colab) – questionto42 May 27 '21 at 09:46

1 Answers1

0

You can specify where to download to by using the -p (or --path) flag:

!kaggle competitions download pku-autonomous-driving -p data_folder/

gosuto
  • 5,422
  • 6
  • 36
  • 57