dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
8.94k stars 1.86k forks source link

Method 'call' in type 'Microsoft.ML.TorchSharp.NasBert.Models.TransformerEncoder' from assembly 'Microsoft.ML.TorchSharp #6779

Open aarindam10 opened 12 months ago

aarindam10 commented 12 months ago

the bug was reported earlier in following post. https://github.com/dotnet/machinelearning/issues/6665 though the bug was marked as resolved and closed the thread, but still the issues is there.

Reopening the issue:

Now I am using following versions. PackageReference Include="Microsoft.ML" Version="2.0.1" PackageReference Include="Microsoft.ML.TorchSharp" Version="0.20.1" PackageReference Include="TorchSharp" Version="0.100.3" PackageReference Include="TorchSharp-cpu" Version="0.100.3"

still getting following errors

System.TypeLoadException HResult=0x80131522 Message=Method 'call' in type 'Microsoft.ML.TorchSharp.NasBert.Models.TransformerEncoder' from assembly 'Microsoft.ML.TorchSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' does not have an implementation. Source=Microsoft.ML.TorchSharp StackTrace: at Microsoft.ML.TorchSharp.NasBert.NasBertTrainer2.TrainerBase..ctor(NasBertTrainer2 parent, IChannel ch, IDataView input) at Microsoft.ML.TorchSharp.NasBert.TextClassificationTrainer.Trainer..ctor(NasBertTrainer2 parent, IChannel ch, IDataView input) at Microsoft.ML.TorchSharp.NasBert.TextClassificationTrainer.CreateTrainer(NasBertTrainer2 parent, IChannel ch, IDataView input) at Microsoft.ML.TorchSharp.NasBert.NasBertTrainer2.Fit(IDataView input) at Microsoft.ML.Data.EstimatorChain1.Fit(IDataView input) at Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input) at CustomerReview.CustomerReviewAnalysis.ReviewAnalysis() in F:\MachineL\MLNet\CustomerReviewAnalysis\CustomerReviewAnalysis.cs:line 80 at Program.

$(String[] args) in F:\MachineL\MLNet\CustomerReviewAnalysis\Program.cs:line 6

gabriele-ricci-kyklos commented 9 months ago

@aarindam10 as pointed out in the issue you linked, you need to install the TorchSharp-cpu version 0.98.1: https://github.com/dotnet/machinelearning/issues/6665#issuecomment-1542819386 I had the exact same issue and solved by installing the correct nuget package version

GeorgeS2019 commented 9 months ago

@michaelgsharp Please add deep-learning label to all TorchSharp issues image