Tensorflow2.0 如何调用ExampleValidator来分析拆分的数据集?

Tensorflow2.0 如何调用ExampleValidator来分析拆分的数据集?,tensorflow2.0,tfx,Tensorflow2.0,Tfx,使用: 在这样的交互式上下文中: Tensorflow version: 2.3.1 TFX version: 0.23.1 TFDV version: 0.24.0 TFMA version: 0.24.0 我使用以下方法创建了一个ExampleGen: from tfx.orchestration.experimental.interactive.interactive_context import \ InteractiveContext context = Interactiv

使用:

在这样的交互式上下文中:

Tensorflow version: 2.3.1
TFX version: 0.23.1
TFDV version: 0.24.0
TFMA version: 0.24.0
我使用以下方法创建了一个ExampleGen:

from tfx.orchestration.experimental.interactive.interactive_context import \
    InteractiveContext
context = InteractiveContext(
    pipeline_root=os.path.join(os.getcwd(), "pipeline")
)
在后面的代码中,我尝试使用ExampleValidator评估数据,但ExampleValidator似乎无法解析到拆分数据集的正确路径

验证程序的创建按预期工作:

output = example_gen_pb2.Output(
             split_config=example_gen_pb2.SplitConfig(splits=[
                 example_gen_pb2.SplitConfig.Split(name='train', hash_buckets=7),
                 example_gen_pb2.SplitConfig.Split(name='test', hash_buckets=2),
                 example_gen_pb2.SplitConfig.Split(name='eval', hash_buckets=1)
             ]))

example_gen = CsvExampleGen(input_base=os.path.join(base_dir, data_dir), output_config=output)
context.run(example_gen)
没有警告或错误,但尝试显示结果时,路径上的错误不正确:

example_validator = ExampleValidator(
             statistics=statistics_gen.outputs['statistics'],
             schema=schema_gen.outputs['schema'])
context.run(example_validator)
NotFoundError:/home/jovyan/pipeline/ExampleValidator/exceptions/16/exceptions.pbtxt;没有这样的文件或目录

实际的目录结构如下所示:

context.show(example_validator.outputs['anomalies'])
但代码似乎期望:

.
└── anomalies
    └── 16
        ├── eval
        │   └── anomalies.pbtxt
        ├── test
        │   └── anomalies.pbtxt
        └── train
            └── anomalies.pbtxt

5 directories, 3 files

如何调用ExampleValidator来分析拆分数据集?

感谢@Lorin S.分享解决方案参考。为了社区的利益,我在这里提供1025KB在中给出的解决方案(答案部分)

在TFX 0.23版本中添加了拆分,但Colab在0.23中未更新。 Colab固定为0.24


问题是通过将tfx升级到0.24来解决的。请注意,Keras组件示例也遇到了相同的问题,因此我打开了一个问题。问题是通过将tfx升级到0.24来解决的
└── anomalies
    └── 16
        └── anomalies.pbtxt