Last active
January 30, 2020 06:18
-
-
Save korakot/44d6add0e9eca83f3c9bbb94b929505f to your computer and use it in GitHub Desktop.
Download Kaggle data into Google Colab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| !mkdir ~/.kaggle | |
| !echo '{"username":"korakot","key":"8db2e62c9fcbb3d2cc204a01671189num+2"}' > ~/.kaggle/kaggle.json | |
| !chmod 600 ~/.kaggle/kaggle.json | |
| # list files | |
| !kaggle datasets files robervalt/sunspots | |
| # load one file | |
| !kaggle datasets download robervalt/sunspots -f Sunspots.csv | |
| # load all files as a zip | |
| !kaggle datasets download robervalt/sunspots |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Must already have kaggle.json from Kaggle in GDrive | |
| # see https://github.com/Kaggle/kaggle-api#api-credentials | |
| from google.colab import drive | |
| drive.mount('mount') # need to authenticate | |
| # copy kaggle token file | |
| !mkdir ~/.kaggle | |
| !cp mount/My\ Drive/kaggle.json ~/.kaggle/ | |
| !chmod 600 ~/.kaggle/kaggle.json | |
| # install kaggle module for command line usage | |
| !pip install -q kaggle | |
| # search for datasets | |
| !kaggle datasets list -s dogs | |
| # list files in a dataset | |
| !kaggle datasets files -d zillow/zecon | |
| # load a specific file into .kaggle/datasets | |
| !kaggle datasets download -d zillow/zecon -f State_time_series.csv |
Author
Author
For ImageNet 2012:
!kaggle competitions download -c imagenet-object-localization-challenge
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Load มาหมดของทั้ง competition นั้น
!kaggle competitions download -w -c spooky-author-identification-w คือ เก็บใน working directory คือ ไม่ไปสร้าง sub directory