首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >mlflow异常:使用UUID运行已处于活动状态

mlflow异常:使用UUID运行已处于活动状态
EN

Stack Overflow用户
提问于 2020-02-19 01:34:08
回答 2查看 1.1K关注 0票数 0

使用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。目前陷入了这个无限循环中。有什么建议吗?

代码语言:javascript
复制
    mlflow.set_experiment("my_experiment")
    mlflow.start_run(run_name='my_project')
    mlflow.set_tag('input_len',len(input))
    mlflow.log_param('metrics', r2)
EN

回答 2

Stack Overflow用户

发布于 2021-08-24 20:23:21

我的情况略有不同,但我在这里发布了解决方案,以防它对这个帖子的新手有所帮助。我在开始跑步之前不小心设置了跑步标签

代码语言:javascript
复制
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先于所有其他日志记录/标记解决了问题

票数 0
EN

Stack Overflow用户

发布于 2021-11-24 13:39:04

在我的例子中,我在set_tracking_uri()之后使用了mlflow.get_artifact_uri()。

Mlflow为get_artifact_uri()函数创建了一个run,当我们再次尝试启动一个run时,它抛出了上面的异常。

错误代码

代码语言:javascript
复制
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)        
代码语言:javascript
复制
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()。而且它起作用了。

工作代码

代码语言:javascript
复制
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)    
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60286506

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档