question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sample fails with "The size of input lines is not consistent"

See original GitHub issue

I’m trying out the sample shown here. However, whenever I try to train the model I get an error: “The size of input lines is not consistent”. This is using the exact files that are specified in the tutorial so I’m not sure where I’m going wrong - any ideas?

#r "netstandard"
#load @"C:\Users\Isaac\Source\Repos\scratchpad\.paket\load\netstandard2.0\ML\ml.group.fsx"

open Microsoft.ML
open Microsoft.ML.Runtime.Api
open Microsoft.ML.Transforms
open Microsoft.ML.Trainers

let dataPath = @"data\imdb_labelled.txt"
let testDataPath = @"data\yelp_labelled.txt"

type SentimentData =
    { [<Column(ordinal = "0")>] SentimentText : string
      [<Column(ordinal = "1", name = "Label")>] Sentiment : float }

[<CLIMutable>]
type SentimentPrediction =
    { [<ColumnName "PredictedLabel">] Sentiment : bool }

let pipeline = LearningPipeline()
pipeline.Add(TextLoader<SentimentData>(dataPath, useHeader = false, separator = "tab"))
pipeline.Add(TextFeaturizer("Features", "SentimentText"))
pipeline.Add(FastTreeBinaryClassifier(NumLeaves = 5, NumTrees = 5, MinDocumentsInLeafs = 2))

/// Pop!
let model = pipeline.Train<SentimentData, SentimentPrediction>()

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:19 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
eerhardtcommented, May 22, 2018

Are native folders a “proper” thing in NuGet packages?

Check out https://docs.microsoft.com/en-us/nuget/create-packages/supporting-multiple-target-frameworks#architecture-specific-folders for the docs on the runtimes folder:

If you have architecture-specific assemblies, that is, separate assemblies that target ARM, x86, and x64, you must place them in a folder named runtimes within sub-folders named {platform}-{architecture}\lib{framework} or {platform}-{architecture}\native

0reactions
dsymecommented, Jul 30, 2018

After doing #600 I think there is no F#-specific issue remaining here, see https://github.com/dotnet/machinelearning/issues/180 for the record issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Found input variables with inconsistent numbers of ...
I've converted all of the labels into int64 numerical data and loaded into X and Y as a numpy array, but I am...
Read more >
Found input variables with inconsistent numbers of ...
That's why you get an inconsistent number of samples error. You can navigate this by. predicting on X_test prediction = model.predict(X_test).
Read more >
C38: Using CSS width, max-width and flexbox to fit labels ...
This technique ensures labels and inputs do not break out of their layout area, including in one-column layouts where it would cause horizontal...
Read more >
Why the number input is the worst input
If you are building a form that requires conditional validations or calculations, it is hard to understate just how big of a problem...
Read more >
line-height - CSS: Cascading Style Sheets - MDN Web Docs
The line-height CSS property sets the height of a line box. It's commonly used to set the distance between lines of text.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found