Search code examples
c#visual-studio-2022ml.net

Fail to install runtime Visual Studio error


I've a super strange error "fail to install runtime" when I'm starting to train my ML.NET model and I'm using Ml.NET Model Builder. Of course I tried to reisntall Visual Studio, twice, and tried to laucnh environment via admin - same problem

Some screenshots:

enter image description here

enter image description here

enter image description here

UPD: error message

  1. at Microsoft.ML.ModelBuilder.AutoMLService.RuntimeManager.InstallRuntimeAsync(Boolean skipIfExist, CancellationToken ct) in //src/Microsoft.ML.ModelBuilder.AutoMLService/RuntimeManager/RuntimeManager.cs:line 172 at Microsoft.ML.ModelBuilder.AutoMLService.LocalImageClassificationExperiment.ExecuteAsync(IDataView trainData, IDataView validateData, CancellationToken ct) in //src/Microsoft.ML.ModelBuilder.AutoMLService/Experiments/LocalImageClassificationExperiment.cs:line 49 at Microsoft.ML.ModelBuilder.AutoMLEngine.StartTrainingAsync(ITrainingConfiguration config, PathConfiguration pathConfig, CancellationToken userCancellationToken) in /_/src/Microsoft.ML.ModelBuilder.AutoMLService/AutoMLEngineService/AutoMLEngine.cs:line 178

  2. restore "c:\program files\microsoft visual studio\2022\professional\common7\ide\extensions\pee5r3yg.zb0\AutoMLService\RuntimeManager\tensorflow.cpu.csproj" --configfile "c:\program files\microsoft visual studio\2022\professional\common7\ide\extensions\pee5r3yg.zb0\AutoMLService\RuntimeManager\NuGet.config" -r win-x64 /p:UsingToolXliff=false /p:TorchSharpVersion=0.103.1 /p:TorchSharpCudaRuntimeVersion=2.4.0 /p:TensorflowRuntimeVersion=2.3.1 /p:BaseIntermediateOutputPath="C:\Users\Дамир\AppData\Local\ModelBuilder\tensorflow-cpu.2.3.1\obj" publish "c:\program files\microsoft visual studio\2022\professional\common7\ide\extensions\pee5r3yg.zb0\AutoMLService\RuntimeManager\tensorflow.cpu.csproj" -r win-x64 -c Release --no-self-contained -o "C:\Users\Дамир\AppData\Local\ModelBuilder\tensorflow-cpu.2.3.1" --no-restore /p:UsingToolXliff=false /p:TorchSharpVersion=0.103.1 /p:TorchSharpCudaRuntimeVersion=2.4.0 /p:TensorflowRuntimeVersion=2.3.1 /p:BaseOutputPath="C:\Users\Дамир\AppData\Local\ModelBuilder\tensorflow-cpu.2.3.1\bin\" /p:BaseIntermediateOutputPath="C:\Users\Дамир\AppData\Local\ModelBuilder\tensorflow-cpu.2.3.1\obj\" start installing runtime in C:\Users\Дамир\AppData\Local\ModelBuilder\tensorflow-cpu.2.3.1 The command could not be loaded, possibly because:

  • You intended to execute a .NET application: The application 'restore' does not exist.
  • You intended to execute a .NET SDK command: No .NET SDKs were found.

Solution

  • This error indicates that the .NET SDK is not installed or not properly configured. To fix:

    Install .NET SDK: Download and install the latest .NET SDK from Microsoft's .NET Download page. Verify Installation: Run dotnet --info in the command prompt to ensure the SDK is installed and recognized. Check Environment Variables: Ensure the PATH environment variable includes the .NET SDK path, typically C:\Program Files\dotnet. Retry the Command: Run the restore and publish commands again.