我希望将从mlflow获得的参数和度量保存到s3桶中。通常,我是通过在mlflow中设置tracking_uri来获得这些数据的,这样可以将其保存在服务器上,但在这种情况下,我不能拥有一个服务器(有人拒绝),我只想以与使用tracking_uri相同的方式将参数和度量存储在s3桶上。
我可以将工件存储在s3桶上,而不会出现问题,但不能存储params/度量。
以下是一些代码:
def mlflow_testing():
tracking_uri = "s3://bucket_name/mlflow/",
experiment_name = "test",
artifact_uri= "s3://bucket_name/mlflow/"
mlflow.set_tracking_uri(tracking_uri)
mlflow.create_experiment(experiment_name, artifact_uri)
mlflow.set_experiment(experiment_name)
with mlflow.start_run() as run:
mlflow.log_param("test1", 0)
mlflow.log_metric("test2", 1)
with open("test.txt", "w") as f:
f.write("this is an artifact")
mlflow.log_artifact("test.txt")
mlflow.end_run()这可以将工件文本文件存储在s3桶上(只要我使uri成为本地路径,比如local_data/mlflow而不是s3桶)。
为s3设置tracking_uri桶会导致以下错误:
mlflow.tracking.registry.UnsupportedModelRegistryStoreURIException:
Model registry functionality is unavailable; got unsupported URI
's3://bucket_location/mlflow/' for model registry data storage.
Supported URI schemes are: ['', 'file', 'databricks', 'http', 'https',
'postgresql', 'mysql', 'sqlite', 'mssql']. See
https://www.mlflow.org/docs/latest/tracking.html#storage for how to
run an MLflow server against one of the supported backend storage
locations.有没有人建议在不设置服务器的情况下绕过这个问题?我只想要那些指标和标准。
发布于 2022-05-19 22:34:19
S3不是MLFlow度量和参数支持的后端。它是支持工件的后端。https://www.mlflow.org/docs/latest/tracking.html#where-runs-are-recorded
如果愿意,您可以在本地编写度量/参数,并将其按计划上传到S3作为备份。
https://stackoverflow.com/questions/72238610
复制相似问题