将ADLS连接到AML中的笔记本时出错

问题描述 投票:1回答:1

我在连接基于AML笔记本创建和注册的数据集时遇到错误。当我在Designer中连接此数据集时,我可以将其可视化。下面是我正在使用的代码。如果有人遇到相同的错误,请让我知道解决方案。

示例1将数据集导入notebbok

from azureml.core import Workspace, Dataset

subscription_id = 'abcd'
resource_group = 'RGB'
workspace_name = 'DSG'

workspace = Workspace(subscription_id, resource_group, workspace_name)
dataset = Dataset.get_by_name(workspace, name='abc')
dataset.to_pandas_dataframe()

错误1

ExecutionError: Could not execute the specified transform.
(Error in getting metadata for path /local/top.txt.
Operation: GETFILESTATUS failed with Unknown Error: The operation has timed out..
Last encountered exception thrown after 5 tries.
[The operation has timed out.,The operation has timed out.,The operation has timed out.,The operation has timed out.,The operation has timed out.]
[ServerRequestId:])|session_id=2d67

示例2将数据从数据存储区导入到笔记本中

from azureml.core import Workspace, Datastore, Dataset

datastore_name = 'abc'
workspace = Workspace.from_config()

datastore = Datastore.get(workspace, datastore_name)
datastore_paths = [(datastore, '/local/top.txt')]
df_ds = Dataset.Tabular.from_delimited_files(
    path=datastore_paths, validate=True,
    include_path=False, infer_column_types=True,
    set_column_types=None, separator='\t',
    header=True, partition_format=None
    )

df = df_ds.to_pandas_dataframe()

错误2

Cannot load any data from the specified path. Make sure the path is accessible.
azure-data-lake azure-machine-learning-service
1个回答
0
投票

尝试从路径'local/top.txt'中删除初始斜杠

datastore_paths = [(datastore, 'local/top.txt')]

© www.soinside.com 2019 - 2024. All rights reserved.