【问题标题】:Return parameters in Kubeflow pipeline componentKubeflow 管道组件中的返回参数
【发布时间】:2022-12-18 12:42:14
【问题描述】:

我试图从 kubeflow 组件返回几个参数。按照文档,它说你应该使用 OutputPath,其中 T 是 python 中的一种类型(str、float、int ...),所以我有这个:

@component
def basic_data_drifting(current_csv: Input[Dataset],
                        reference_csv: Input[Dataset],
                        report_html: Output[HTML],
                        data_drift_score: OutputPath(float),
                        value: OutputPath(float)):

我知道,对于文档,如果我的参数是一个字符串,我应该使用:

with open(myoutputpathstr, 'w') as output_file:
    output_file.write("my string")

但我找不到任何返回花车的例子。整数、布尔值……我应该将它们转换为 str 吗?总是将它们存储为文件? <T> 而不是只有 str 有什么意义?

提前致谢!

【问题讨论】:

    标签: kubeflow kubeflow-pipelines


    【解决方案1】:

    This documentation 显示了您所需要的——返回不同数据类型的多个输出。

    如果您是 Kubeflow 的新手,请使用 Kubeflow 提供的collection of examples 作为参考来源。

    你也可以看看minimal sample pipeline here

    快乐的实验!

    【讨论】:

      猜你喜欢
      • 2019-09-23
      • 2020-10-27
      • 2021-02-02
      • 2021-02-15
      • 2020-12-16
      • 2022-10-16
      • 2020-11-18
      • 2023-02-15
      • 2022-01-18
      相关资源
      最近更新 更多