我在 Keras 中开发了一个模型,在读取本地存储的数据时可以完美运行。但是,我现在想利用 Google Cloud Platform 的 GPU 来训练模型。我已经在 GCP 上设置了 GPU,并且正在使用 Jupyter 笔记本。我已将图像移至 Google Cloud Storage。
我的问题是:
如何使用ImageDataGenerator类的 Keras 的 flow_from_directory 方法直接从 Cloud Storage 访问这些图像(特别是目录 - 训练、验证、测试)?
这是我在 Google Cloud Storage (GCS) 中的目录结构:
mybucketname/
class_1/
img001.jpg
img002.jpg
...
class_2/
img001.jpg
img002.jpg
...
class_3/
img001.jpg
img002.jpg
...