【发布时间】:2019-09-17 16:36:40
【问题描述】:
我正在尝试在大约 16gb 的图像数据上训练模型。我需要从我的 Cloud Storage 存储桶中导入一个 annotations.mat 文件。但是,由于loadmat 需要文件路径,我不确定如何导入 Google Storage 存储桶路径。我尝试创建 mat 数据的 pickle 文件,但 Jupyter Notebook 崩溃。
当前尝试:
from google.cloud import storage
client = storage.Client()
bucket = client.get_bucket('bucket-id')
blob = bucket.get_blob('path/to/annotations.pkl')
# crashes here
print(blob.download_as_string())
我想做类似的事情:
import scipy.io as sio
client = storage.Client()
bucket = client.get_bucket('bucket-id')
matfile = sio.loadmat(buket_path + 'path/to/annotations.pkl')
有人知道如何从 Cloud Storage 存储桶加载 mat 文件吗?
【问题讨论】:
标签: machine-learning jupyter-notebook google-cloud-storage mat