Skip to content

TextLoader().CreateFrom() Unhandled Exception for version 0.2.0 #318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
helloguo opened this issue Jun 6, 2018 · 0 comments
Closed

TextLoader().CreateFrom() Unhandled Exception for version 0.2.0 #318

helloguo opened this issue Jun 6, 2018 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@helloguo
Copy link

helloguo commented Jun 6, 2018

System information

  • OS Windows 10:
  • .NET Version 2.1.300-rc1-008673:

Issue

  • What did you do?

I move my code from ML.NET version 0.1.0 to ML.NET version 0.2.0. I have a data structure FlightData looks like following. Then I use pipeline.Add(new TextLoader(trainingDataSet).CreateFrom<FlightData>(useHeader: true, separator: ',', allowQuotedStrings:true)); to load the data.

    public class FlightData
    {
        [Column(ordinal: "0")]
        public float QUARTER;
        [Column(ordinal: "1")]
        public float MONTH;
        [Column(ordinal: "2")]
        public float DAY_OF_MONTH;
        [Column(ordinal: "3")]
        ....
    }
  • What happened?

Error message:

Unhandled Exception: System.InvalidOperationException: DAY_OF_MONTH is not alphanumeric.
   at Microsoft.ML.Data.TextLoader.CreateFrom[TInput](Boolean useHeader, Char separator, Boolean allowQuotedStrings, Boolean supportSparse, Boolean trimWhitespace)

After looking at the error msg and ML.NET source code https://github.com/dotnet/machinelearning/blob/master/src/Microsoft.ML/Data/TextLoader.cs#L87, I change DAY_OF_MONTH to DAYOFMONTH. Then the error disappears. But it's common to use _ in the variable names.

  • What did you expect?

I can use _ in variable names, which are part of Input fed to TextLoader.

Source code / logs

Please paste or attach the code or logs or traces that would be helpful to diagnose the issue you are reporting.

@zeahmed zeahmed self-assigned this Jun 7, 2018
@zeahmed zeahmed added the bug Something isn't working label Jun 7, 2018
@zeahmed zeahmed closed this as completed Jun 13, 2018
@ghost ghost locked as resolved and limited conversation to collaborators Mar 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants