azure-data-lake - 在 AML 中将 ADLS 连接到笔记本时出错
问题描述
我在连接基于 ADLS 的 AML 笔记本中创建和注册的数据集时遇到错误。当我在设计器中连接此数据集时,我能够将其可视化。下面是我正在使用的代码。如果有人遇到同样的错误,请告诉我解决方案。
示例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.
解决方案
对于您的数据集 abc,您能否在 ml.azure.com 上可视化/预览数据?可能是因为您的数据权限在 ADLS 中设置不正确。您需要向服务主体授予您正在访问的文件/文件夹的权限。
https://docs.microsoft.com/en-us/azure/data-lake-store/data-lake-store-access-control
推荐阅读
- python - 使用原始音频数据和 simpleaudio 重新调整录制文件后的大量噪音
- javascript - 检查元素是否在 jQuery 选择器中具有提供的父元素
- c - 访问 C 数组线程中的不同元素是否安全?
- java - java中while循环的时间复杂度
- linux - 使用tar时保存文件名
- java - 图像未在 JavaFX 中显示
- python - 如何处理其数据中包含 \x00(或 \u0000)的 API 响应(JSON),并使用 django 模型将数据存储在 Postgres 中?
- javascript - 尝试访问远程服务器时,React-native fetch 失败并显示“网络请求失败”
- python - 当我尝试创建新项目时,项目类型未在 python 中显示
- python - Cron 日志显示 sh: 1: hdfs: not found