dotnet / machinelearning-modelbuilder

Simple UI tool to build custom machine learning models.
Creative Commons Attribution 4.0 International
264 stars 56 forks source link

Object reference not set to an instance of an object #2454

Open fred-ahead opened 1 year ago

fred-ahead commented 1 year ago

System Information (please complete the following information):

Describe the bug

To Reproduce Steps to reproduce the behavior:

  1. Run mlnet classification --dataset "yelp_labelled.txt" --label-col 1 --has-header false --name SentimentModel --train-time 60mlnet

Expected behavior A successful build of the classification dataset

fred-ahead commented 1 year ago

Only SentimentModel.mbconfig and SentimentModel.zip is created. The application code is not generated.

luisquintanilla commented 1 year ago

Hi @fred-ahead

Sorry to hear you ran into this issue. We're looking into it.

@LittleLittleCloud can you please take a look at this one. Thanks.

derekforeman commented 1 year ago

I am seeing the same issue mlnet version : 16.14.2+48a74e849ab32700b5af6489a96ff50c0e3bc429

LittleLittleCloud commented 1 year ago

Looking at it

LittleLittleCloud commented 1 year ago

We push a fix for it, in the meanwhile, a workaround can be adding a $Path variable in your system environment.

fred-ahead commented 1 year ago

@LittleLittleCloud What is missing from the path? Happy to do that, just need to know what to add to my path.

LittleLittleCloud commented 1 year ago

@fred-ahead The content of $Path doesn't matter. This issue is caused because mlnet cli can't find $Path environment variable is missing in the system.

joanimato commented 1 year ago

@LittleLittleCloud can you elaborate? I'm running into the same exact issue with the mlnet cli on MacOs. My path variable is set and displays correctly when doing echo $PATH

LittleLittleCloud commented 1 year ago

@joanimato sure. We just push a fix to nuget and please update to the latest cli to deploy the fix.

More details on this error if anyone interests

MLNet cli checks if env:path exists in environment by calling

var path = Environment.GetVariable("Path")

and then adds runtime folder into env:Path.

by calling

if (!path.contain(runtimefolder))
    path = /path/to/runtime;path

The problem is Environment.GetVariable("Path") returns a null if "Path" doesn't exist. And if "Path" is null, calling path.contain will trigger an object reference not set instance exception.

fred-ahead commented 1 year ago

If it checks for Path then that is most likely the issue as on a Mac the PATH variable is all caps. Path does not work for Mac, neither does path. PATH does work though. On Windows the capitalization doesn't matter.

fred-ahead commented 1 year ago

To be clear, on a Mac this issue is easily resolved by doing the following:

export Path=$PATH

I was able to easily build the code with the above command.

LittleLittleCloud commented 1 year ago

it might affect text classification GPU training in Mac. @LittleLittleCloud to look into