[英]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 上,您需要执行以下操作:
/tmp/my-image.png
将图像存储在驱动程序的本地文件系统中,例如/tmp/my-image.png
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.