https://www.kaggle.com/general/74235
Easiest way to download kaggle data in Google Colab | Data Science and Machine Learning
Easiest way to download kaggle data in Google Colab.
www.kaggle.com
1. Go to your account, Scroll to API section and Click Expire API Token to remove previous tokens
2. Click on Create New API Token - It will download kaggle.json file on your machine.
3. Go to your Google Colab project file and run the following commands:
1) ! pip install -q kaggle
2) from google.colab import files
files.upload()
- Choose the kaggle.json file that you downloaded
3) ! mkdir ~/.kaggle
! cp kaggle.json ~/.kaggle/
- Make directory named kaggle and copy kaggle.json file there.
4) ! chmod 600 ~/.kaggle/kaggle.json
- Change the permissions of the file.
5) ! kaggle datasets list
- That's all ! You can check if everything's okay by running this command.
Download Dataset
!kaggle datasets download -d kozodoi/timm-pytorch-image-models
Download Data
! kaggle competitions download -c 'name-of-competition'
Use unzip command to unzip the data:
For example,
Create a directory named train,
! mkdir train
unzip train data there,
! unzip train.zip -d train
특정 대회 이름 가져오기
! kaggle competitions list
여기서 대회 이름 찾기
<competition name>에 찾은 이름 넣고 실행
!kaggle competitions download -c <competition name>
이 방법 외에 사이트에서 복사해올 수도 있다
'Machine Learning > Tip' 카테고리의 다른 글
[Kaggle] How to import pre-trained model Despite of Offline (2) | 2021.11.09 |
---|---|
Repository 생성 후 작성한 코드 올리기 (0) | 2021.11.06 |
Google Drive의 zip파일을 Colab에서 unzip하기 (0) | 2021.10.26 |
[Mediapipe] Hands (0) | 2021.06.25 |
OpenCV python 설치 (0) | 2021.06.24 |