使用mlflow.set_tracking_uri设置tracking_uri和set_experiment,得到一个错误,并再次检查以运行以下代码。收到错误消息"Exception: Run with UUID is an active“。尝试使用mlflow.end_run结束当前运行,但未找到RestException: RESOURCE_DOES_NOT_EXIST: run UUID。目前陷入了这个无限循环中。有什么建议吗?
mlflow.set_experiment("my_experiment")
mlflow.start_run(run_name='my_project')
mlflow.set_tag('input_len',len(input))
mlflow.log_param('metrics', r2)发布于 2021-08-24 20:23:21
我的情况略有不同,但我在这里发布了解决方案,以防它对这个帖子的新手有所帮助。我在开始跑步之前不小心设置了跑步标签
mlflow.set_experiment('my_experiment')
mlflow.set_tag('input_len', len(input)) # Auto-creates a run ID
mlflow.start_run(run_name='my_project') # Tries to name the same run, throwing error确保start_run先于所有其他日志记录/标记解决了问题
发布于 2021-11-24 13:39:04
在我的例子中,我在set_tracking_uri()之后使用了mlflow.get_artifact_uri()。
Mlflow为get_artifact_uri()函数创建了一个run,当我们再次尝试启动一个run时,它抛出了上面的异常。
错误代码
mlflow.set_tracking_uri("http://localhost:5000")
mlflow.set_experiment('Exp1')
print('artifact uri:', mlflow.get_artifact_uri())
with mlflow.start_run():
mlflow.log_param('SIZE',100) Exception: Run with UUID f7d3c1318eeb403cbcf6545b061654e1 is already active. To start a new run, first end the current run with mlflow.end_run(). To start a nested run, call start_run with nested=True因此,必须在start_run内容中使用get_artifact_uri()。而且它起作用了。
工作代码
mlflow.set_tracking_uri("http://localhost:5000")
mlflow.set_experiment('Exp1')
with mlflow.start_run():
print('artifact uri:', mlflow.get_artifact_uri())
mlflow.log_param('SIZE',100) https://stackoverflow.com/questions/60286506
复制相似问题