如何从自定义 Python 函数 TFX 组件传播 mlpipeline-metrics?

问题描述

注意:这是 GitHub issue I reported 的副本。

重新发布希望引起更多关注,我会在任一站点上更新任何解决方案。

问题

我想从我的自定义 Python 函数 TFX 组件导出 mlpipeline-metrics,使其为 displayed in the KubeFlow UI

这是我正在尝试做的一个最小的例子:

import json

from tfx.dsl.component.experimental.annotations import OutputArtifact
from tfx.dsl.component.experimental.decorators import component
from tfx.types.standard_artifacts import Artifact

class Metric(Artifact):
    TYPE_NAME = 'Metric'

@component
def ShowMetric(MLPipeline_Metrics: OutputArtifact[Metric]):

    rmse_eval = 333.33

    metrics = {
        'metrics':[
            {
                'name': 'RMSE-validation','numberValue': rmse_eval,'format': 'RAW'
            }
        ]
    }

    path = '/tmp/mlpipeline-metrics.json'
    
    with open(path,'w') as _file:
        json.dump(metrics,_file)

    MLPipeline_Metrics.uri = path

在 KubeFlow UI 中,“运行输出”选项卡显示“未找到此运行的指标”。但是,输出人工制品显示在 ML 元数据中(请参见屏幕截图)。任何有关如何实现这一点的帮助将不胜感激。谢谢!

Screenshot of KubeFlow UI

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...