TFX管道TFTransform组件报Split does not exist over all example artifacts错误
TFX 管道TFTransform组件Split不存在错误修复方案
报错信息:
ValueError: "Split does not exist over all example artifacts"
根因说明
该报错由get_split_uris()函数触发,核心原因是输入到TFTransform的Example Artifact拆分维度不一致,运行时函数消耗的Artifact数量和检索匹配到的URI数量不匹配。你提前拆分的target、candidate属于自定义拆分,TFX默认仅自动识别train、eval、test三类标准拆分,未显式配置的自定义拆分无法被全链路组件对齐识别。
修复步骤
修正CSVExampleGen的输入配置,显式映射自定义拆分与对应文件
正确配置示例:from tfx.components import CsvExampleGen from tfx.proto import example_gen_pb2 input_cfg = example_gen_pb2.Input( splits=[ example_gen_pb2.Input.Split(name='target', pattern='target.csv'), example_gen_pb2.Input.Split(name='candidate', pattern='candidate.csv'), ] ) example_gen = CsvExampleGen( input_base='/path/to/csv_storage', input_config=input_cfg )显式指定TFTransform组件的处理拆分列表,避免组件默认读取标准拆分
配置示例:from tfx.components import Transform transform = Transform( examples=example_gen.outputs['examples'], schema=schema_gen.outputs['schema'], module_file='/path/to/transform_logic.py', splits_to_transform=['target', 'candidate'] )若仍报错,检查SchemaGen输出的schema文件是否包含对应自定义拆分的元数据,不要在Transform业务逻辑中硬编码拆分名称,统一使用组件传入的拆分参数即可。
内容的提问来源于stack exchange,提问作者John Sukup
相关产品推荐
相关产品推荐

