Error while importing Kaggle dataset on Colab

后端 未结 7 2019
长发绾君心
长发绾君心 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:01

    five Easy steps:

    Step 1: Import the drive

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

    Get authorize code from https://accounts.google.com/o/oauth2/auth?client_id=xxx and enter the code at Enter your authorization code:

    Step 2: Download the kaggle.json file in the local system

    kaggle.com -> My account -> create

    Step 3: Upload the kaggle.json file. Click > at top left corner of Colab to get

    panel -> Files -> UPLOAD

    Step 4: Copy the file to Colab

    !cp /your path/kaggle.json ~/.kaggle/kaggle.json
    

    Step 5: Fix Warning

    Your Kaggle API key is readable by other users on this system!

    !chmod 600 /root/.kaggle/kaggle.json
    

    TEST

    !pip install kaggle
    import kaggle
    !kaggle competitions list --csv
    

    RESULT

    ref,deadline,category,reward,teamCount,userHasEntered digit-recognizer,2030-01-01 00:00:00,Getting Started,Knowledge,2867,False titanic,2030-01-01 00:00:00,Getting Started,Knowledge,11221,False house-prices-advanced-regression-techniques,2030-01-01 00:00:00,Getting Started,Knowledge,4353,True imagenet-object-localization-challenge,2029-12-31 07:00:00,Research,Knowledge,40,False competitive-data-science-predict-future-sales,2019-12-31 23:59:00,Playground,Kudos,2780,False two-sigma-financial-news,2019-07-15 23:59:00,Featured,"$100,000",2927,False aerial-cactus-identification,2019-07-08 23:59:00,Playground,Knowledge,377,False jigsaw-unintended-bias-in-toxicity-classification,2019-06-26 23:59:00,Featured,"$65,000",982,False inaturalist-2019-fgvc6,2019-06-10 23:59:00,Research,Kudos,75,False freesound-audio-tagging-2019,2019-06-10 11:59:00,Research,"$5,000",250,False

提交回复
热议问题