简体   繁体   English

ML 组件在指向 Azure Data Lake Store Gen2 的 Azure Databricks (7.3.9) 中不起作用

[英]ML Components not working in Azure Databricks (7.3.9) pointing to Azure Data Lake Store Gen2

I'm facing issues while trying to store Matplotlib graph in Azure Data Lake Store Gen2 by processing the Kmeans Elbow method from Local Pycharm pointing to Azure Databricks cluster. I'm facing issues while trying to store Matplotlib graph in Azure Data Lake Store Gen2 by processing the Kmeans Elbow method from Local Pycharm pointing to Azure Databricks cluster.

For the below sample piece of ML code, am getting the error.对于下面的 ML 代码示例,我收到了错误消息。

Elbow Curve:弯头曲线:

import matplotlib.pyplot as plt

plt.savefig(graph_path, bbox_inches='tight')

Class shaded.databricks.azurebfs.org.apache.hadoop.fs.azurebfs.SecureAzureBlobFileSystem not found. Class shaded.databricks.azurebfs.org.apache.hadoop.fs.azurebfs.SecureAzureBlobFileSystem 未找到。 OSError: [Errno 22] Invalid argument: 'abfss://cluster-container@project.dfs.core.windows.net/project/output/Elbow-Curve-20210325-222650.png' OSError:[Errno 22] 无效参数:'abfss://cluster-container@project.dfs.core.windows.net/project/output/Elbow-Curve-20210325-222650.png'

Note: The code runs without any issues when pointed to local spark and local folder structure, the issue is with either Databricks or Azure Data Lake Store Gen2.注意:当指向本地 spark 和本地文件夹结构时,代码运行没有任何问题,问题在于 Databricks 或 Azure Data Lake Store Gen2。

Any help is much appreciated!任何帮助深表感谢!

Matplotlib doesn't know anything about the ADLS - it's designed to work with local file system. Matplotlib 对 ADLS 一无所知 - 它旨在与本地文件系统一起使用。 So to store image on the ADLS you need to do following:因此,要将图像存储在 ADLS 上,您需要执行以下操作:

  1. Store the image on the local file system of the driver, for example, as /tmp/my-image.png将图像存储在驱动程序的本地文件系统中,例如/tmp/my-image.png
  2. Copy the image into ADLS using the dbutils.fs.cp command, like this (see documentation for details):使用dbutils.fs.cp命令将映像复制到 ADLS,如下所示(有关详细信息,请参阅文档):
dbutils.fs.cp("file:/tmp/my-image.png", graph_path)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将 PDF 上传到 Azure 数据湖存储 Gen2 - Upload PDF to Azure Data Lake store Gen2 Azure 数据湖存储 Gen2 权限 - Azure Data Lake storage Gen2 permissions Azure Databricks:无法连接到 Azure Data Lake Storage Gen2 - Azure Databricks: can't connect to Azure Data Lake Storage Gen2 Azure Databricks 通过服务主体访问 Azure Data Lake Storage Gen2 - Azure Databricks accessing Azure Data Lake Storage Gen2 via Service principal 从 Azure Data Lake Gen2 数据存储创建 Azure ML 数据集时出现 AuthenticationException - AuthenticationException when creating Azure ML Dataset from Azure Data Lake Gen2 Datastore Azure 的“Data Lake Storage Gen2”和“Data Lake Gen2”有什么区别? - What is the difference between Azure's "Data Lake Storage Gen2" and "Data Lake Gen2"? 使用 Azure CLI 将用户权限添加到 Data Lake Store Gen2 文件夹 - Add user rights to Data Lake Store Gen2 Folder with Azure CLI Azure Datalake Store Gen2中的数据屏蔽 - Data masking in Azure Datalake Store Gen2 不能对 Azure Data Lake Gen2 文件使用通配符 - Can't use wildcard with Azure Data Lake Gen2 files 无法在 csharp 中的 Azure Data Lake Gen2 中设置 blob 的 ContentType - Cannot set the ContentType of a blob in Azure Data Lake Gen2 in csharp
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM