Using Google Colab, this article I want to download the data.
#kaggleAPI upload from google.colab import files files.upload () ! mkdir -p ~/.kaggle ! mv kaggle.json ~/.kaggle / from google.colab import drive drive.mount ('/ root/drive') ! chmod 600 /root/.kaggle/kaggle.json ! kaggle competitions download -c dogs-vs-cats
When the above code was executed, the following message appeared.
Warning: Looks like you're using an outdated API Version, please consider updating (server 1.5.6/client 1.5.4) 403-Forbidden
When I examined it, there is an article that the 403 error occurs because it is not joined to the Kaggle competition,
This competition is already over and there is no button to join.
How can I download a dataset from Google Colab?
If i know anyone, I would appreciate it.
Answer # 1
from google.colab import drive drive.mount ('/ root/drive') import os ! mkdir -p Colab os.getcwd () '/ content/Colab'
If you look at Google Drive in this state, you can see the Colab directory, so if you copy the file from the PC side, it will be uploaded.
! ls -lsa/root/drive/My \ Drive/Colab / total 304 304 -rw ------- 1 root root 310547 Aug 24 07:03 39766.pdf
Answer # 2
You may not understand the intent of the question, but Isn't it downloaded by pressing the "Download All" button on the page?
Dogs vs. Cats
I think you upload the code when you run it. . .
! pip install -U kaggle
The message has changed.
Saving kaggle.json to kaggle.json Drive already mounted at/root/drive;to attempt to forcibly remount, call drive.mount ("/ root/drive", force_remount = True). 403-Forbidden
Answer # 3
The 403 error occurs because you are not joining the Kaggle competition
As you said, you can download it when you join another competition.
! kaggle competitions download -c severstal-steel-defect-detection Downloading severstal-steel-defect-detection.zip to/content/Colab 100% 1.29G/1.29G [00:12<00:00, 102MB/s] 100% 1.29G/1.29G [00:12<00:00, 115MB/s]
Since the desired competition is over, can I just drop it locally from the "Download All" button and upload it?
The operation of kaggle was based on the following Qiita article.
[Python memo] Unusual code&usage using the Kaggle API in Google Colaboratory
- python - about uploading youtube using google-auth
- about attendance scheduling using python pulp
- python 3x - python3 about passing local variables
- about passing the python path
- about reading json file in python
- about nesting python lists
- python - how to judge pass/fail using keras
- python 3x - please tell me about the error statement of pyqt5
- about python pandas cumulative sum
- python - about the babylonian square root
- when i try to send a dm using the twitter api in python, 403 comes back
- python - pitch, yaw, roll calculation method using cv2rodrigues
- python - about messages that appear during pytorch backward
- python - data conversion using pandas
- python - i want to shorten the code using a for statement
- i try to move ffmpeg using subprocess in python on windows10, but i get an error
- python - i'm using a rasp pie to move the servo, but pigpio stops halfway
- python - crash when using tkinter from anaconda on macos 10146 mojave
- python 3x - typeerror: 'method' object is not subscriptable
- python - you may need to restart the kernel to use updated packages error
- xcode - pod install [!] no `podfile 'found in the project directory
- android studio - emulator: dsound: could not initialize about the error message directsoundcapture
- android studio - unresolved reference comes out in kotlin
- vuejs - [vuetify] unable to locate target [data-app] i want to unit test to avoid warning
- django - oserror: [winerror 123] the file name, directory name, or volume label syntax is incorrect : '<frozen importlib_boot
- mysql startup failed [error] innodb: the innodb_system data file 'ibdata1' must be writable
- python 3x - import error "cannot import name '_imaging'"