不使用 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 檔案系統來存取 MLflow 執行成品時 (DBFS) 命令,例如 dbutils.fs ,您會收到下列錯誤: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 實驗許可權擴充功能時,將不再支援儲存在中的 run 成品 DBFS 存取 Api dbfs:/databricks/mlflow-tracking/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

使用嘗試存取 MLflow 執行成品時 %sh / os.listdir() ,您會收到下列錯誤: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 實驗許可權擴充功能時, dbfs:/databricks/mlflow-tracking/ 只可使用 MLflow client 1.9.1 版或更新版本來存取儲存在中的構件。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