dotnet / dotnet/machinelearning

Error inferring columns with AutoML in Blazor WASM

Open
#7,249 1 comment 0 reactions 0 assignees View on GitHub
area-AutoML untriaged
Dominant language
C#
Stars
9.4k
Forks
2k
Avg merge
2d 20h
Merged PRs (30d)
11

Description

I am trying to use AutoML in Blazor WASM and I am receiving this error message no matter what data source file I am using: 
`Unable to split the file provided into multiple, consistent columns. Readable formats include delimited files such as CSV/TSV. Check for a consistent number of columns and proper escaping and quoting.`

I tried different csv/tsv files and same error everytime. I also tried basically same code and same data file running in a console application and it worked fine.
And I also tried downloading the file after uploading it, and examined it in vscode, nothing seemed to be wrong, no issue for linebreaking...

This is my code and the error is popping when trying to infercolumns...
```
public async Task LoadFiles(InputFileChangeEventArgs e)
{
var file = e.File;
var fileName = file.Name;

// Saving file
await using FileStream fs = new(fileName, FileMode.Create);
await file.OpenReadStream(1024*1024*1024).CopyToAsync(fs);

// Initialize MLContext
MLContext ctx = new MLContext();

// Define data path
var dataPath = Path.GetFullPath(fileName);

// Infer column information
ColumnInferenceResults columnInference = ctx.Auto().InferColumns(
dataPath,
labelColumnIndex: 0,
hasHeader: true,
// separatorChar: ',',
groupColumns: false,
allowQuoting: true,
trimWhitespace: true
);
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.