ml.net - 使用 ML.NET 开始训练后“无法将提供的文件拆分为多个一致的列”
问题描述
我正在使用 ML.NET 进行机器学习。
最初,我使用 CSV 文件并收到此错误。但是,当我连接到使用相同数据设置的数据库表时,我遇到了同样的问题。数据是不同长度和内容的文本,我想基于此生成新文本。
我的文本只有一列,所以我不明白这是在做什么,也不明白为什么它不起作用。任何指针将不胜感激。
Inferring Columns ...
An Error occured during inferring columns
Unable to split the file provided into multiple, consistent columns.
Microsoft.ML.AutoML.InferenceException: Unable to split the file provided into multiple, consistent columns.
at Microsoft.ML.AutoML.ColumnInferenceApi.InferSplit(MLContext context, TextFileSample sample, Nullable`1 separatorChar, Nullable`1 allowQuotedStrings, Nullable`1 supportSparse)
at Microsoft.ML.AutoML.ColumnInferenceApi.InferColumns(MLContext context, String path, ColumnInformation columnInfo, Nullable`1 separatorChar, Nullable`1 allowQuotedStrings, Nullable`1 supportSparse, Boolean trimWhitespace, Boolean groupColumns)
at Microsoft.ML.CLI.CodeGenerator.AutoMLEngine.InferColumns(MLContext context, ColumnInformation columnInformation)
at Microsoft.ML.CLI.Program.<>c__DisplayClass1_0.<Main>b__0(NewCommandSettings options)
at Microsoft.ML.CLI.CodeGenerator.CodeGenerationHelper.GenerateCode()
Please see the log file for more info.
Exiting ...
解决方案
当这个错误发生在我身上时,我找不到太多关于它的信息。我所做的是将我的 sql 数据库导出到 csv 并查看数据。有一些字符串描述中有换行符和 html。我用一些 c# 清理了字符串,文件加载并运行良好。
如果我是你,我会检查 csv 中的数据并查找格式错误,然后修复这些错误并重试。
推荐阅读
- java - Java中可重入锁中的“重入”到底是什么?
- flutter - 配置项目 image_cropper 时出现问题
- javascript - 两个特定点 P5.js 之间的嘈杂线
- java - Apache Camel RabbitMQ 消费者在不可恢复错误时自动恢复
- powershell - PowerShell - 如何检查“不包含”子句?
- postgresql - sequelize nested include table 有一个条目,但是不能从这部分查询中引用
- python - 如何使用 Cython 将带有原始数据的 std::stringstream 从 C++ 传递到 Python
- python - 这个 Python 程序有什么问题
- firebase - 每次为相同的 URI 和信息创建一个新的 Firebase 动态链接
- javascript - 内容安全策略间歇性错误