dotnet / TorchSharp

A .NET library that provides access to the library that powers PyTorch.
MIT License
1.4k stars 181 forks source link

NotSupportedException: This application or script uses TorchSharp but doesn't contain a reference to libtorch-cpu-win-x64 #1264

Open hoangdung3498 opened 8 months ago

hoangdung3498 commented 8 months ago

I install following package : TorchSharp-cpu version: 0.101.6 And it automatically installs additional TorchSharp(0.101.6) and libtorch-cpu,libtorch-cpu-linux-x64,libtorch-cpu-osx-x64,libtorch-cpu-win-x64 (all is version 2.1.0.1) Visual Studio 2022 17.8.3 Set up to run on project asp.net MVC in .NET Framwork 4.7.2

When i try use "_var idxtensor = torch.arange(62);" , it raise error :" NotSupportedException: This application or script uses TorchSharp but doesn't contain a reference to libtorch-cpu-win-x64".

first , i have installed only TorchSharp-cpu in console app and it not work, but after “Migrate pakages.config to PackageReference” it work. So then i tried same thing in asp.net program and i stuck again. I also sure that i run in x64 and all dll is ready in bin of asp.net. I also clear torch package in .../.nuget/packages/ and reinstall but still error. I am grateful for any solution now.

KevinKrueger commented 5 months ago

Same problem!

oscar811 commented 5 months ago

Same here!