Closed aforoughi1 closed 1 year ago
Does the API only work for two classes as in your sample? The API didn't work in preview version and remains a showstopper in the release version. Please can you investigate?
The issue caused by libtorchsharp . I had installed only torchsharp package. The sample TCRunner.Run() masked the exception. To resolve it I next installed torchsharp-cpu package. The pipeline. Fit() took 38 mins. Useful to add the debugging code mlContext.Log += (o, e) => { if (e.Source.Contains("NasBertTrainer")) Console.WriteLine(e.Message); };
System.DllNotFoundException
HResult=0x80131524
Message=Unable to load DLL 'LibTorchSharp' or one of its dependencies: The specified module could not be found. (0x8007007E)
Source=TorchSharp
StackTrace:
at TorchSharp.PInvoke.LibTorchSharp.THSNN_custom_module(String name, ForwardFunctionC forward, IntPtr& pBoxedModule)
at TorchSharp.torch.nn.Module..ctor(String name)
at Microsoft.ML.TorchSharp.NasBert.Models.BaseModel..ctor(Options options)
at Microsoft.ML.TorchSharp.NasBert.Models.NasBertModel..ctor(Options options, Int32 padIndex, Int32 symbolsCount, Int32 numClasses)
at Microsoft.ML.TorchSharp.NasBert.NasBertTrainer`2.TrainerBase..ctor(NasBertTrainer`2 parent, IChannel ch, IDataView input)
at Microsoft.ML.TorchSharp.NasBert.TextClassificationTrainer.CreateTrainer(NasBertTrainer`2 parent, IChannel ch, IDataView input)
at Microsoft.ML.TorchSharp.NasBert.NasBertTrainer`2.Fit(IDataView input)
at Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
at Test.TCRunner.Run(TrialSettings settings)
System Information (please complete the following information):
Describe the bug My source data structure
I reused the sample from https://github.com/dotnet/machinelearning-samples/tree/main/samples/csharp/getting-started/MLNET2/AutoMLTrialRunner
I get the exception when I retrieve the Model from TrialResult
To Reproduce
Additional context A cutdown sample data file is attached FinancialPhraseBank.txt