Skip to content
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

Specified Label '<LabelName>' was not found #1027

Closed
roberthleone opened this issue Oct 2, 2020 · 23 comments
Closed

Specified Label '<LabelName>' was not found #1027

roberthleone opened this issue Oct 2, 2020 · 23 comments

Comments

@roberthleone
Copy link

Operating System: windows 10 pro

Provide details about the problem you're experiencing. Include your operating system version, exact error message, code sample, and anything else that is relevant.

I created a dotnet core console app, right clicked the console app project, added machine learning, chose a scenario, selected a csv file for training which had 7 columns, selected the column I wanted it to predict, selected 5 of them to use as part of the learning, then I get the error listed above I used the as a substitute for my actual label name because I didn't think it really mattered.

@beccamc
Copy link
Contributor

beccamc commented Oct 2, 2020

@roberthleone Sorry you ran into this problem! Are you able to share you dataset (or part of your dataset) with us?

@roberthleone
Copy link
Author

DateAndNumbers.csv.txt

@roberthleone
Copy link
Author

roberthleone commented Oct 2, 2020

I added the .txt at the end because I wasn't able to add the .csv file type to this report not to the app in visual studio 2019 community v16.7.5

@roberthleone
Copy link
Author

@beccamc, did the file supplied help figure out the root cause of my issue?

@beccamc
Copy link
Contributor

beccamc commented Oct 13, 2020

@roberthleone Thanks for supplying your data! I wasn't able to reproduce, the model trained successfully for me. Is your VS in a different language than English?

image

@sfiruch
Copy link

sfiruch commented Nov 18, 2020

I hit the same problem. Here's the stack trace

Specified label column 'Test' was not found.
   at Microsoft.ML.AutoML.ColumnTypeInference.GetAndValidateLabelColumn(Arguments args, IntermediateColumn[] cols)
   at Microsoft.ML.AutoML.ColumnTypeInference.InferTextFileColumnTypesCore(MLContext context, IMultiStreamSource fileSource, Arguments args)
   at Microsoft.ML.AutoML.ColumnInferenceApi.InferColumnTypes(MLContext context, TextFileSample sample, ColumnSplitResult splitInference, Boolean hasHeader, Nullable`1 labelColumnIndex, String label)
   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, Boolean hasHeader)
   at Microsoft.ML.ModelBuilder.AutoMLEngine.InferColumns(MLContext context, AutoMLServiceParameter config) in /_/src/Microsoft.ML.ModelBuilder.AutoMLService/AutoMLEngineService/AutoMLEngine.cs:line 271
   at Microsoft.ML.ModelBuilder.AutoMLEngine.<StartTrainingAsync>d__26.MoveNext() in /_/src/Microsoft.ML.ModelBuilder.AutoMLService/AutoMLEngineService/AutoMLEngine.cs:line 114

How to repro:

  1. Create a .NET Core console app
  2. Add "Machine Learning"
  3. Select "Custom scenario"
  4. Load the above example file
  5. Pick "Test" as column to predict
  6. Click "Train"
  7. Click "Start Training"

Things I noticed

  • The "Data preview" in the "2. Data" tab shows the data correctly
  • It says "Status: Failed. See more in Output Pane". The Output Pane "Machine Learning" is empty.
  • It also fails with the same exception after removing the Date column
  • It also fails with the same exception when I replace "," with ";" in the CSV
  • The command line tool mlnet works fine.
  • I use an English Visual Studio on an English Windows installation, with mostly Swiss German Date/Time formats and Swiss German keyboard layout.

@beccamc
Copy link
Contributor

beccamc commented Nov 19, 2020

Thanks for reporting @deiruch! What version of Model Builder are you on? Based on your report I think you're on an older version. In our most recent release (16.3.0.2056001) we've completely changed how your data file is processed. Could you give it another try with the new build?

@sfiruch
Copy link

sfiruch commented Nov 19, 2020

This happens with ML.NET Model Builder (Preview) v16.3.0.2056001.

@beccamc
Copy link
Contributor

beccamc commented Nov 19, 2020

Thanks! I'll take a look

@beccamc
Copy link
Contributor

beccamc commented Nov 23, 2020

@deiruch I'm able to train successfully with the dataset provided by roberthleone. Are you using the same dataset?

I also used an English VS and English Windows.

  1. Are your time fields also formatted like this? 3/20/2020
  2. Do you maybe have a trailing comma at the end of every line in your dataset?

@sfiruch
Copy link

sfiruch commented Nov 24, 2020

I tested with the file roberthleone provided above, without modifications. So:

  1. Yes, the dates in the file are formatted like 3/20/2020.
  2. No

@csdahlberg
Copy link

I have encountered the same error when following the step-by-step instructions from https://dotnet.microsoft.com/learn/ml-dotnet/get-started-tutorial/intro, including using the sample data file of https://raw.githubusercontent.com/dotnet/machinelearning/master/test/data/wikipedia-detox-250-line-data.tsv.

I see the same behavior with versions 16.1.0.2027905 and 16.3.0.2056001 of the ML.NET Model Builder (Preview) extension, and in both 16.8.2 and 16.9.0 Preview 2.0 of Visual Studio 2019 Community Edition. It does not seem to matter which scenario or training task I select.

@bsstahl
Copy link

bsstahl commented Mar 28, 2021

Is there any update here? A workaround maybe? I'm running into this same problem with the same 2 versions of the tool (16.1.0.20207905 then upgraded to 16.3.0.2056001). It is turning what should have been a very quick experiment to see if I could get any predictive value out of a dataset into a frustratingly difficult exercise. I have tried the data in both csv and tsv format, tried smaller sets, tried adding and eliminating any trailing lines. I can't share the exact dataset but I could make one that would demonstrate the problem if it will help.

@beccamc
Copy link
Contributor

beccamc commented Apr 1, 2021

@bsstahl Yes, please share a dataset that repros the problem! Can you also please share your machine and VS language settings?

@sfiruch
Copy link

sfiruch commented Apr 2, 2021

@bsstahl Yes, please share a dataset that repros the problem! Can you also please share your machine and VS language settings?

As I posted in November already, I can repro the problem with the OP's dataset. Let me know if you need additional information from me.

@bsstahl
Copy link

bsstahl commented Apr 3, 2021

I have what I think is some good news. It turns out that one of my machines works with this dataset, while another doesn't. I've posted all of the details I can think of at this point documenting the differences between these two setups as well as the dataset I used. Hopefully that will lead to a resolution.

The key thing to me is that the UIs look very different. So different in fact, that it doesn't seem possible that I am actually running the same version of the tooling on both machines. However, for the things I know to look at, the versions are the same. Perhaps there is something else that is installed that I need to check?

You can find my write-up here: https://cognitiveinheritance.com/Posts/Troubleshooting-Machine-Learning-ModelBuilder-Issue-1027.html

@beccamc
Copy link
Contributor

beccamc commented Apr 6, 2021

@bsstahl Thank you for the details!! The UI from the machine having the failure is very old. Did you have a version of Model Builder installed on the problem machine prior to when we started shipping with VS? This would have been sometime last summer.

@deiruch @csdahlberg Are both of you seeing a UI similar to this?
image

If the UI looks like this for all of you, the problem is that the extension upgrade is broken. Even though the extension manager says 16.3.0.2056001 you're actually on a much much older version. This would explain why I can't get a repro of the problem no matter what machine settings I change.

@sfiruch
Copy link

sfiruch commented Apr 7, 2021

I reinstalled VS and switched to VS Preview last week (unrelated problem). I can no longer repro the problem - it works as expected. 👍

@beccamc
Copy link
Contributor

beccamc commented Apr 7, 2021

@deiruch Excellent! So happy that worked.

To give more context on the situation. We believe the problem is there are two version installed. We shipped one version on a VS Preview channel last summer. We then changed how our extension is packaged/shipped. The old packaged version and the new packaged version have the same package ID, but based on breaking changes the new version didn't overwrite the old. Both versions are still there, but the new one is showing in the extension manager and the old one is loading when you try to use the extension.

To fix: Please uninstall Model Builder - both from the Extension Manager Window and from the Visual Studio Installer. Then re-install from the VS Installer, and update to the latest version from the Marketplace. You should see a new UI similar to this...

image

Sorry about the delay in resolving this issue everyone! Thank you for your patience, and let me know if complete Model Builder uninstall/reinstall doesn't work. If the old package is still sticking around you may need to reinstall the VS Preview build.

@bsstahl
Copy link

bsstahl commented Apr 8, 2021

I was unable to fully uninstall the Extension. Once I rolled-back (and restarted) to the point where the Extension manager offered me the opportunity to uninstall, it would open the VS Installer and fail with the message Microsoft.ML.ModelBuilder: No matching workload or component found. I ended up having to do a full uninstall-reinstall of Visual Studio. That worked, and I can now generate models on that machine using this tool. Thanks @beccamc and everyone else who worked to figure this out.

@beccamc
Copy link
Contributor

beccamc commented Apr 8, 2021

Glad it worked! I'll also re-try my uninstall instructions and see if it needs to be done in the other order. Thanks for the heads up.

@beccamc
Copy link
Contributor

beccamc commented Apr 23, 2021

Has anyone else been able to fix their problem with the above advice?

@beccamc
Copy link
Contributor

beccamc commented Apr 29, 2021

It seems like this is solved for those who tried the solution. If anyone else runs into problems, and the above advice doesn't work, please @ mention me for help. Thank you everyone for reporting and helping to resolve this!

@beccamc beccamc closed this as completed Apr 29, 2021
@beccamc beccamc removed their assignment Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants