Colab 让我创建一个存储桶,但在哪里?

Colab tells me to create a bucket, but where?

在 Google Colab 上使用 TPU 时(例如在 MNIST example 中),我们被告知要创建一个 GCS 存储桶。但是,它没有告诉我们在哪里。不知道Colab实例的region/zone,怕运行造成计费问题,不敢创建bucket。

其实有几个问题:

  1. 从 Colab 访问 GCS 存储桶是免费的,还是收取正常的网络出口费用?
  2. 能否获取colab实例的region/zone? Most likely not.
  3. 如果以上两个问题的问题都是"no":在将 TPU 与 Colab 结合使用时,是否有任何解决方案可以最大限度地降低成本?

感谢您的提问。

不,您无法获取 colab 实例的 region/zone。因此,您可以尝试创建一个应该可由 colab 访问的多区域 GCS 存储桶。根据评论,https://github.com/googlecolab/colabtools/issues/597#issuecomment-502746530,Colab TPU 实例仅在美国地区。所以在创建GCS bucket的时候,可以选择美国的Multi-region bucket。

查看 https://cloud.google.com/storage/pricing 以获取有关 GCS 存储桶定价信息的更多详细信息。

您还可以在 https://cloud.google.com/free/ 注册一个 Google Cloud Platform 帐户,提供 5GB 免费存储空间和 300 美元的信用额度,这样应该能够为您提供足够的信用额度来开始.

We are told to create a GCS bucket. However, it doesn't tell us where.

运行(在 Colab 内)

!curl ipinfo.io

你得到类似于

的东西
{
  "ip": "3X.20X.4X.1XX",
  "hostname": "13X.4X.20X.3X.bc.googleusercontent.com",
  "city": "Groningen",
  "region": "Groningen",
  "country": "NL",
  "loc": "53.21XX,6.56XX",
  "org": "AS396XXX Google LLC",
  "postal": "9711",
  "timezone": "Europe/Amsterdam",
  "readme": "https://ipinfo.io/missingauth"
}

这告诉你你的 Colab 在哪里运行。

您可以只在一个区域创建一个 GCS 存储桶(如果您不需要多区域)。

假设您不经常更改 country/area,您可以检查几次(不同的日子)并了解您的 Colab 可能位于何处。

对于您的其他问题(出口,...),请参阅结论 https://ostrokach.gitlab.io/post/google-colab-storage/

[...] Google Cloud Storage is a good option for hosting our data. Only we should be sure to check that the Colab notebook is running in the same continent as your Cloud Storage bucket, or we will incur network egress charges!