TFX示例\u Gen生成运行时错误

2024-04-23 06:27:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我在运行context.run(example_gen)时遇到了以下错误,我想了解这意味着什么,以及如何避免出现错误。请提前提出建议和感谢

错误:RuntimeError: Files in same split /home/jupyter/.../data/* have different header.

数据为csv,标题为“a、B、C、D”

from  tfx.proto import example_gen_pb2

base_dir = '/home/jupyter/.../data/'
#Input has a single split 'input_dir/*
#Output 2 splits: train:eval=3:1.'
output = example_gen_pb2.Output(
            split_config=example_gen_pb2.SplitConfig(splits=[
                example_gen_pb2.SplitConfig.Split(name='train', hash_buckets=3),
                example_gen_pb2.SplitConfig.Split(name='eval', hash_buckets=1)
            ]))

examples = csv_input(os.path.join(base_dir))
example_gen = CsvExampleGen(input=examples, output_config=output)

Tags: csvhomeinputoutputdatabaseexample错误
1条回答
网友
1楼 · 发布于 2024-04-23 06:27:56

我们也犯了同样的错误。在我们的例子中,目录还包含隐藏的文件。更准确地说,是一个jupyter笔记本检查点目录

要解决此问题:请确保目录仅包含.csv文件。没有其他(隐藏)文件

github上this comment的学分

相关问题 更多 >