问题描述
使用:
Tensorflow version: 2.3.1
TFX version: 0.23.1
TFDV version: 0.24.0
TFMA version: 0.24.0
具有这样的交互式上下文:
from tfx.orchestration.experimental.interactive.interactive_context import \
InteractiveContext
context = InteractiveContext(
pipeline_root=os.path.join(os.getcwd(),"pipeline")
)
我使用以下方法创建了ExampleGen:
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)
在随后的代码中,我尝试使用ExampleValidator评估数据,但是ExampleValidator似乎无法解析拆分数据集的正确路径。
创建验证器的工作符合预期:
example_validator = ExampleValidator(
statistics=statistics_gen.outputs['statistics'],schema=schema_gen.outputs['schema'])
context.run(example_validator)
没有警告或错误,但是试图显示结果,路径上的错误不正确:
context.show(example_validator.outputs['anomalies'])
NotFoundError:/home/jovyan/pipeline/ExampleValidator/anomalies/16/anomalies.pbtxt;没有这样的文件或目录
实际的目录结构如下:
.
└── anomalies
└── 16
├── eval
│ └── anomalies.pbtxt
├── test
│ └── anomalies.pbtxt
└── train
└── anomalies.pbtxt
5 directories,3 files
但是代码似乎期望:
└── anomalies
└── 16
└── anomalies.pbtxt
如何调用ExampleValidator分析拆分数据集?