在不使用 MLflow 客户端的情况下访问 MLflow 项目时出错Errors when accessing MLflow artifacts without using the MLflow client

现在,对 MLflow 跟踪中的项目实施了 MLflow 试验权限,使你可以轻松控制对数据集、模型和其他文件的访问。MLflow experiment permissions are now enforced on artifacts in MLflow Tracking, enabling you to easily control access to your datasets, models, and other files.

“无效装载”异常Invalid mount exception

问题Problem

尝试使用 Databricks 文件系统 (DBFS) 命令(如 dbutils.fs)访问 MLflow 运行项目时,收到以下错误:When trying to access an MLflow run artifact using Databricks File System (DBFS) commands, such as dbutils.fs, you get the following error:

com.databricks.backend.daemon.data.common.InvalidMountException: Error while using path /databricks/mlflow-tracking/<experiment-id>/<run-id>/artifacts for resolving path &#39;/<experiment-id>/<run-id>/artifacts&#39; within mount at &#39;/databricks/mlflow-tracking&#39;.

原因Cause

随着 MLflow 试验权限扩展到项目,dbfs:/databricks/mlflow-tracking/ 中存储的运行项目的 DBFS 访问 API 不再受到支持。With the extension of MLflow experiment permissions to artifacts, DBFS access APIs for run artifacts stored in dbfs:/databricks/mlflow-tracking/ are no longer supported.

解决方案Solution

升级到 MLflow 客户端版本 1.9.1 或更高版本,以便下载、列出或上传存储在 dbfs:/databricks/mlflow-tracking/中的项目。Upgrade to MLflow client version 1.9.1 or above to download, list, or upload artifacts stored in dbfs:/databricks/mlflow-tracking/.

%sh
pip install --upgrade mlflow

FileNotFoundErrorFileNotFoundError

问题Problem

尝试使用 %sh/os.listdir() 访问 MLflow 运行项目时,收到以下错误:When trying to access an MLflow run artifact using %sh/os.listdir(), you get the following error:

FileNotFoundError: [Errno 2] No such file or directory: '/databricks/mlflow-tracking/'

原因Cause

随着 MLflow 试验权限扩展到项目,只能使用 MLflow 客户端版本 1.9.1 或更高版本访问存储在 dbfs:/databricks/mlflow-tracking/ 中的运行项目。With the extension of MLflow experiment permissions to artifacts, run artifacts stored in dbfs:/databricks/mlflow-tracking/ can only be accessed using MLflow client version 1.9.1 or above.

解决方案Solution

升级到 MLflow 客户端版本 1.9.1 或更高版本,以便下载、列出或上传存储在 dbfs:/databricks/mlflow-tracking/中的项目。Upgrade to MLflow client version 1.9.1 or above to download, list, or upload artifacts stored in dbfs:/databricks/mlflow-tracking/.

%sh
pip install --upgrade mlflow