我正在将文本数据集导入到Google顶点AI,并得到以下错误:
Hello Vertex AI Customer,
Due to an error, Vertex AI was unable to import data into
dataset [dataset_name].
Additional Details:
Operation State: Failed with errors
Resource Name: [resoure_link]
Error Messages: There are too many rows in the jsonl/csv file. Currently we
only support 1000000 lines. Please cut your files to smaller size and run
multiple import data pipelines to import.我检查了我从熊猫生成的数据集和实际的CSV文件,它只有600 K行。
有人犯过类似的错误吗?
发布于 2021-12-09 05:19:20
所以这是我的CSV格式中的一个错误。
我忘了修剪文本数据集中的换行符和额外的空格。这就解决了100万行的计数问题。但是在这样做之后,我发现告诉我我有太多的标签,而它只有2,这是错误的。
Error Messages: There are too many AnnotationSpecs in the dataset. Up to
5000 AnnotationSpecs are allowed in one Dataset.这是因为我在中使用to_csv()方法创建了文本数据集。通过这种方式创建一个CSV文件,当你的文本只包含一个",“(逗号字符)时,它将自动放置引号。因此CSV文件看起来如下:
"this is a sentence, with a comma", 0
this is a sentence without a comma, 1同时,顶点AutoML文本希望CSV看起来如下所示:
"this is a sentence, with a comma", 0
"this is a sentence without a comma", 1也就是说,你必须在每一行上加引号。
这可以通过编写自己的CSV格式化程序来实现,或者如果您坚持使用Pandas to_csv(),则可以将csv.QUOTE_ALL传递给引用参数。它看起来是这样的:
import csv
df.to_csv("file.csv", index=False, quoting=csv.QUOTE_ALL, header=False)https://stackoverflow.com/questions/70109346
复制相似问题