【问题标题】:Cannot read data with Cloud Storage FUSE无法使用 Cloud Storage FUSE 读取数据
【发布时间】:2022-12-13 21:37:04
【问题描述】:

在 Vertex AI 工作台笔记本中,我尝试使用 Cloud Storage FUSE 从 Cloud Storage 读取数据。 Cloud Storage 中数据集的文件路径为: gs://my_bucket_name/cola_public/raw/in_domain_train.tsv 这样我就可以将它读入 pandas dataframe,如下所示:

import pandas as pd

# Load the dataset into a pandas dataframe.
df = pd.read_csv("gs://my_bucket_name/cola_public/raw/in_domain_train.tsv", delimiter='\t', header=None, names=['sentence_source', 'label', 'label_notes', 'sentence'])

# Report the number of sentences.
print('Number of training sentences: {:,}\n'.format(df.shape[0]))

# Display 10 random rows from the data.
df.sample(10)

前面的代码可以无缝运行。但是,我想更新我的代码以使用 Cloud Storage FUSE 读取数据(用于稍后的 Vertex AI 训练)。基于Read and write Cloud Storage files with Cloud Storage FUSEthis Codelab,我应该能够使用以下代码加载我的数据:

df = pd.read_csv("/gcs/my_bucket_name/cola_public/raw/in_domain_train.tsv", delimiter='\t', header=None, names=['sentence_source', 'label', 'label_notes', 'sentence'])

不幸的是,它对我不起作用。错误信息是:

FileNotFoundError: [Errno 2] No such file or directory: '/gcs/my_bucket_name/cola_public/raw/in_domain_train.tsv'

我该如何解决这个问题? 先感谢您!

【问题讨论】:

    标签: google-cloud-platform google-cloud-storage google-cloud-vertex-ai gcsfuse


    【解决方案1】:

    感谢Ayush Sethi 的回答:

    您是否尝试执行上述代码实验室的step 5? GCS 桶在执行步骤 5 时安装。因此,在步骤 5 中描述的 VertexAI 上作为训练作业运行时,在步骤 4 中容器化的训练应用程序代码应该能够访问 GCS 桶中存在的数据。

    【讨论】:

      猜你喜欢
      • 2020-07-25
      • 2020-03-26
      • 2021-01-24
      • 2017-04-11
      • 2021-04-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多