1

我正在使用 TensorFlow Extended 并堆栈在加载的 .csv 文件中。此文件有;分隔,默认无法读取 TFX 生成器CsvExampleGen()。它抛出以下错误:ValueError: Columns do not match specified csv headers

我发现这个问题与内部依赖关系有关,例如tft.coders.CsvCoder()不需要默认参数来解析 .csv 文件。

问题如下:

  • 如何从中抛出tft.coders.CsvCoder()参数tfx.components.CsvExampleGen
from tfx.components import CsvExampleGen
from tfx.utils.dsl_utils import external_input

data_path = './data'
intro_component = CsvExampleGen(input=external_input(data_path))
...
4

1 回答 1

1

从评论中

当前的解决方案是使用 pandas 转换数据文件:

df = pd.read_csv(_file_path, sep=';')

df.to_csv(_file_path)

(从奥莱克斯转述)。

于 2020-10-13T13:05:29.070 回答