【问题标题】:TFX Example_Gen Produce RuntimeErrorTFX Example_Gen Produce RuntimeError
【发布时间】:2020-07-22 05:55:07
【问题描述】:

我在运行 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)

【问题讨论】:

    标签: python runtime-error tensorflow2.0 tfx


    【解决方案1】:

    我们遇到了同样的错误。在我们的例子中,该目录还包含隐藏文件。更准确地说,是一个 jupyter notebook 检查点目录。

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

    this comment 在 github 上的积分。

    【讨论】:

      猜你喜欢
      • 2020-09-06
      • 1970-01-01
      • 2021-05-24
      • 1970-01-01
      • 2020-02-29
      • 1970-01-01
      • 2022-12-27
      • 2022-11-28
      • 1970-01-01
      相关资源
      最近更新 更多