Skip to content

System.InvalidOperationException: 'LightGBM Error, code is -1 #5431

Closed

Description

@gharibkhani
  • Tested on Windows 10 and Server 2019:
  • .NET 4.7:
  • Microsoft.ML (1.5.2)
  • LightGbm (3.0.0)

Issue
It crashes in this line

  • var model = pipeline.Fit(trainData);

  • I get this error: System.InvalidOperationException: 'LightGBM Error, code is -1, error message is 'Unknown importance type: only support split=0 and gain=1'.'

This error can be reproduced by an example. I just used the example in docs.microsoft.com and able to reproduce it.

https://docs.microsoft.com/en-us/dotnet/api/microsoft.ml.lightgbmextensions.lightgbm?view=ml-dotnet

I created a console app and you can access it from the link below:

https://drive.google.com/drive/folders/1-wc04CM75-IGoxjRAniDuhqI-zrHTWwM?usp=sharing

I talked to the LightGBM team and they mentioned this issue exists in .Net code and not theirs.

Activity

  1. gharibkhani commented on Oct 16, 2020

    @gharibkhani
    Author

    @Lynx1820 would you please look at this and let me know if there is any plan to fix this issue.

  2. self-assigned this
    on Oct 19, 2020
  3. mstfbl commented on Oct 20, 2020

    @mstfbl
    Contributor

    Hi @gharibkhani ,

    Thank you for opening this Issue. I replicated the LightGBM code sample you linked in a fresh new .NET Console App project, and successfully ran the example given. I did not see any failures on the var model = pipeline.Fit(trainData); you said. I installed the Microsoft.ML (1.5.2) and Microsoft.ML.LightGbm (1.5.2) NuGet packages. I believe you may not have the latest Microsoft.ML and/or Microsoft.ML.LightGbm NuGet packages installed, please confirm you have v1.5.2 for both.

    I have zipped the working repro I mention above here. Please unzip the repro I've attach and let me know whether or not it works.
    Issue5431.zip

    Feel free to reopen this issue if the repro I've linked is not working. Thanks.

  4. gharibkhani commented on Oct 20, 2020

    @gharibkhani
    Author

    Hi @mstfbl
    I updated the comment. I am using Microsoft.ML (1.5.2) and LightGbm (3.0.0). My sample has installed these versions as well.
    I do not have permission to reopen this issue. Please open it again.

  5. ghost locked as resolved and limited conversation to collaborators on Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions