【问题标题】:How to load data for TPU inference in Colab, without using GCP?如何在不使用 GCP 的情况下在 Colab 中加载 TPU 推理数据?
【发布时间】:2020-11-18 22:55:48
【问题描述】:

对于在 colab TPU 上训练模型,数据需要位于 GCP 存储桶中。但是,对于少量数据,我想知道是否可以直接从本地 colab 环境中直接推断数据。

【问题讨论】:

    标签: tensorflow google-colaboratory tpu google-cloud-tpu


    【解决方案1】:

    很遗憾,目前无法使用 Colab 将本地数据加载到 TPU 中。您需要继续使用 GCS 存储桶将任何数据加载到 TPU。

    【讨论】:

      【解决方案2】:

      您可以使用 Python 读取文件:

      with open(image_path, "rb") as local_file:
        img = local_file.read()
      

      【讨论】:

        猜你喜欢
        • 2021-01-29
        • 2020-10-31
        • 1970-01-01
        • 1970-01-01
        • 2019-03-02
        • 2012-09-04
        • 2021-08-21
        • 2021-02-17
        • 1970-01-01
        相关资源
        最近更新 更多