Error while importing Kaggle dataset on Colab

后端 未结 7 2011
长发绾君心
长发绾君心 2020-12-30 12:41

When executing the following lines,

!pip install kaggle
!kaggle competitions download -c dogs-vs-cats -p /content/

I got the following erro

相关标签:
7条回答
  • 2020-12-30 13:25

    Initially had trouble copying the .json file into the colab VM. Eventually for me the following worked: working through google colaboratory, first you need to install the kaggle API with:

    !pip install kaggle
    

    Further information and instructions here https://github.com/Kaggle/kaggle-api. Next, the link instructs you to activate the API with a file you can download with your kaggle user on kaggle.com -> My account -> create new API token. this file is kaggle.json.

    Next, in order to upload this kaggle.json file to the colab VM for activation, you can upload it first to your google drive (simply drag it to your drive). Next enter the following command in colab to import your drive:

    from google.colab import drive
    drive.mount('/content/gdrive')
    

    after authorization is completed, you can copy the file from the drive to colab with:

    !cp /content/gdrive/My\ Drive/kaggle.json ~/.kaggle/kaggle.json
    

    And Finally, hopefully you will be able to run the command:

    !kaggle competitions download -c <competition-name>
    

    I hope this helps!

    0 讨论(0)
提交回复
热议问题