本文介绍了如何在MLflow项目中引发异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个引发异常的Mlflow项目.我使用 mlflow.run 执行该功能,但是却得到 mlflow.exceptions.ExecutionException(运行失败(ID'< run_id>')失败").

I have an Mlflow project that raises an exception. I execute that function using mlflow.run, but I get mlflow.exceptions.ExecutionException("Run (ID '<run_id>') failed").

在执行 mlflow.run 时,有什么办法可以获取正在引发的异常吗?

Is there any way I could get the exception that is being raised where I am executing mlflow.run?

或者是否可以从项目内部发送带有自定义消息集的 mlflow.exceptions.ExecutionException ?

Or is it possible to send an mlflow.exceptions.ExecutionException with custom message set from within the project?

推荐答案

不幸的是目前不在.mlflow run启动一个新进程,并且目前没有用于异常传递的协议.通常,其他项目甚至不必使用相同的语言.

Unfortunately not at the moment. mlflow run starts a new process and there is no protocol for exception passing right now. In general the other project does not even have to be in the same language.

我能想到的一种解决方法是通过设置运行标签通过mlflow传递异常.例如:

One workaround I can think of is to pass the exception via mlflow by setting run tag. E.g.:

try:
    ...
except Exception as ex:
    mlflow.set_tag("exception", str(ex))

这篇关于如何在MLflow项目中引发异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 04:48