MLflow 将工件存储在 GCP 存储桶上但无法读取它们

MLflow stores artifacts on GCP buckets but is not able to read them

我发现了一个几乎相同的问题 here 但没有足够的声誉来添加评论所以会再次询问希望有人同时找到解决方案。

我正在使用 MLflow (1.13.1) 来跟踪模型性能,并使用 GCP 存储来存储模型工件。 MLflow 运行 在 GCP VM 实例上,我的 python 应用程序使用具有 Storage Object Creator 和 Storage Object Viewer 角色的服务帐户(然后我还添加了 storage.buckets.get 权限)来存储GCP 存储桶中的工件并从中读取。 一切都按预期工作,参数和指标正确显示在 MLflow UI 中,模型工件正确存储在存储桶中。问题是模型工件没有出现在 MLflow UI 中,因为这个错误:

Unable to list artifacts stored under gs:/******/artifacts for the current run. 
Please contact your tracking server administrator to notify them of this error, 
which can happen when the tracking server lacks permission to list artifacts under the current run's root artifact directory.

引用的工件位置存在并包含正确的模型工件,由于存储对象查看者角色和 storage.buckets.get 权限,MLflow 应该能够读取工件。

有什么可能出错的建议吗?谢谢。

我刚刚发布问题就发现了问题。 我忘记在 GCP VM 上安装 google-cloud-storage 库。现在一切正常。