【问题标题】:How to access Google bucket files using python tensorflow?如何使用 python tensorflow 访问 Google 存储桶文件?
【发布时间】:2018-01-22 14:49:42
【问题描述】:

如果我想在 Google 机器学习引擎(不是本地)的训练作业期间使用 python 访问 Google 存储桶文件。从以下选择中正确的方法是什么(如果有的话)?

第一个选择显然要容易得多,如果有效,是否需要特殊设置,例如:设置特定的桶权限或默认存储类。

最好的问候。

【问题讨论】:

  • “训练”是指训练 ML 模型吗?您是使用 Google Cloud ML Engine、TensorFlow 还是其他一些系统来执行此操作?
  • 是的,我正在使用 tensorflow 在 Google ML 引擎 @BrandonYarbrough 上训练更快的 CNN 模型

标签: python tensorflow google-cloud-storage


【解决方案1】:

不是这个也不是这个。应该使用 tensorflow Gfile 模块如下:

import tensorflow as tf
with tf.gfile.GFile("gs://bucket/file", "r") as f:
        content = f.read()

【讨论】:

    猜你喜欢
    • 2021-02-05
    • 2020-11-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多