【问题标题】:How to download dataset of Kaggle to Colab如何将 Kaggle 的数据集下载到 Colab
【发布时间】:2020-04-28 11:40:29
【问题描述】:

我正在尝试从这个 Kaggle 比赛中下载数据集:

https://www.kaggle.com/c/pku-autonomous-driving/overview

进入 Google Colab。

我从 Kaggle 下载了我的 .json 文件并使用了以下命令:

# Upload data to Google Colab
import os
os.environ['KAGGLE_USERNAME'] = "xxxxxx" # username from the json file
os.environ['KAGGLE_KEY'] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx" # key from the json file
!kaggle competitions download -c pku-autonomous-driving # api copied from kaggle

但这会将所有文件下载到 Google Collab 中,而不会在此过程中创建任何文件夹并将所有内容保存在一起,最终在几分钟后它会失败,因为要下载的请求太多。

我的问题是:如何将其下载为.zip 文件,或以任何其他方式将其下载到 Google Collab 中? (在这里问之前我确实搜索过,但没有找到很好的解决方案)?

我也尝试点击竞赛 API 附近的下载按钮,并复制链接,并尝试使用!wget ("link address"),但这也失败了并且没有开始下载文件。

我还有其他选择可以尝试,例如将其上传到我的 Google 云端硬盘然后安装它,但我确实想知道是否有解决方法。

【问题讨论】:

标签: google-colaboratory kaggle


【解决方案1】:

您可以使用-p(或--path)标志指定下载到的位置:

!kaggle competitions download pku-autonomous-driving -p data_folder/

【讨论】:

    猜你喜欢
    • 2023-03-26
    • 2021-08-15
    • 2020-10-21
    • 2021-01-04
    • 1970-01-01
    • 2021-09-05
    • 2020-04-14
    • 2019-01-27
    • 2018-08-24
    相关资源
    最近更新 更多