有没有办法直接在 Colab 中使用来自 Google Cloud Storage 的数据?

问题描述

我想在 Google Colab 中使用数据集 (170+GB)。我有两个问题:

  1. 既然 Colab 中的可用空间大约为 66GB,那么如果数据托管在 GCS 中,有没有办法直接在 Colab 中使用来自 GCS 的数据?如果没有,可能的解决方案是什么?

  2. 如何将数据集直接从可下载链接上传到 GCS,因为由于可用空间有限,我无法进入 colab?

感谢任何帮助。

解决方法

验证:

from google.colab import auth
auth.authenticate_user()

安装谷歌sdk:

!curl https://sdk.cloud.google.com | bash

初始化 SDK 以配置项目设置。

!gcloud init

1。将文件从 Cloud Storage 下载到 Google Colab

!gsutil cp gs://google storage bucket/your file.csv .

2。将文件从 Google Colab 上传到云端

gsutil cp yourfile.csv gs://gs bucket/

希望有帮助。 Source