【发布时间】:2020-10-24 07:38:06
【问题描述】:
我是 GCP 的新手,因此提前感谢您的耐心等待。我已将一个文件夹(其中包含包含图像的文件夹)上传到我的谷歌云存储桶,现在我想在 jupyter 笔记本的 AI 平台实例上训练一个使用该数据的模型。我已经能够毫无问题地下载单个 blob,但是当需要下载我需要的整个图像数据文件夹时,该文件夹无法识别(我知道它不是 blob,但我仍然需要 jupyter lab 上的本地数据有效地训练模型,对吧?)。我已经看到由于成本原因,FUSE 不是一种选择。我猜有一种方法可以在 GCP 环境中执行此操作,但我无法弄清楚。再次感谢您的帮助!
编辑:
这是(可以理解的)给我一个错误的代码:
blob_name = "five_gestures/"
blob = bucket.get_blob(blob_name)
output_file_name = "gestures/"
blob.download_to_filename(output_file_name)
print("Downloaded blob {} to {}.".format(blob.name, output_file_name))
输出:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-31-9de8423ff843> in <module>
3
4 output_file_name = "gestures/"
----> 5 blob.download_to_filename(output_file_name)
6
7 print("Downloaded blob {} to {}.".format(blob.name, output_file_name))
AttributeError: 'NoneType' object has no attribute 'download_to_filename'
单个图像的路径示例是:
五个手势/00/01_palm/frame_00_01_0001.png
还有 01_palm 包含数百张这样的图像。
【问题讨论】:
-
显示你的代码。
标签: google-cloud-platform jupyter-notebook google-cloud-storage blob gsutil