dotnet / machinelearning-modelbuilder

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

Object Detection Training throws Exception: fail to install runtime #2884

Open jalin168 opened 3 months ago

jalin168 commented 3 months ago

System Information (please complete the following information):

Describe the bug

To Reproduce Steps to reproduce the behavior:

  1. In the Scenario step of Model Builder, select the Object Detection scenario.
  2. In the Environment step, select "CPU" (my CPU is Intel i5-8500, RAM 33GB).
  3. In the Data step, select the button in the Inputs section and use File Explorer to select StopSignObjDetection-export.json located in the Stop-Signs/vott-json-export directory.
  4. In the Train step, select the Start training button.
  5. The error message "fail to install runtime" pops up.

Expected behavior Training should run and complete.

Screenshots 07_MB18_train_08_訓練_fail to install runtime__彈出錯誤

Additional context The following is the Log in the output pane: (Confidential information is replaced with "xxx".)

Set log file path to C:\Temp\MLVSTools\logs\ObjectDetection-NBAZQS.txt
Image List:
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\joshua-hoehne-WPrTKRw8KRQ-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\yannis-h-Sqez8_QTi8o-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\will-porada-ZaGcU6BxJEc-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\untitled-photo-3d6zCZ4lpBE-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\tyler-nix-ahee6DMcUcI-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\tom-dillon-t9Eaei-jz7Y-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\suad-kamardeen-EcQW_Caifz8-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\sandy-ching-ixLUOtNSSHQ-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\samuel-sng-Uj5tQyHS2d0-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\sam-xu-FgY6bF6emj0-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\ron-mcclenny-EpHH_NKwKkE-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\renan-kamikoga-vxx6ilmR-W4-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\phil-garrison-ezvpHWyqsYg-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\pedro-da-silva-unEmGQqdO7Q-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\olivia-connell-Tc9KWrlOL0E-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\naina-vij--j35s3zjPKU-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\melanie-these-mXIViwsTvIc-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\mason-wilkes-q-nm36mpsDw-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\marcos-mathias-Jd7jw1Vf_aI-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\kevork-kurdoghlian-eB2YX2TzNIA-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\luke-van-zyl-rKSHh6nEG1g-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\kevin-lee-dU8dAD8KoOI-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\kelly-sikkema-4KzwQGsDRvA-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\juli-kosolapova-DmtblAatFtk-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\josh-wilburne-3Cs4mF7fL3w-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\jose-alonso-fl9kHTSPSvk-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\jon-tyson-QNp4m7gU7BA-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\jon-tyson-1IqQDH6KgdU-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\john-matychuk-dJdcb11aboQ-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\joel-mott-9r9Ex5iEc5o-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\jad-limcaco-Y_J0phaFy2g-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\giorgio-trovato-7PUrk4B18tY-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\free-to-use-sounds-Vkt3uDeDkdg-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\emiel-van-betsbrugge-rogwZG1NfII-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\eilis-garvey-rb_PpjzWKnU-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\doyoun-seo-Xe1S9aq2fqg-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\diego-lozano-AmZC7bCrsko-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\david-preston-mW2NETqR49A-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\david-preston--t7S0WPRr4E-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\chris-benson-h0UG2Bd_Few-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\chris-bair-PJLDC3tA0Sc-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\brantley-neal-_CAvB1vYIlY-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\branden-tate-XgEHOPn7h_E-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\bogomil-mihaylov-OHxTNeAtNRs-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\ben-mater-YO3iFGBN6TU-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\arthur-osipyan-vLusIJAYy_Q-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\anton-mishin-_AR3i6Gck0Q-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\andrii-leonov-W_rQAwVRPgg-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\alexandre-lecocq-ndBWgMLw6Bc-unsplash.jpg
Image: D:\xxx\xxx\Project\AI\ML.NET\08_ObjectDetection\Stop-Signs\ajda-atz-HEKgHLpNgGk-unsplash.jpg
start Object detection 
restore "c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\vwsqrkhn.ye1\AutoMLService\RuntimeManager\torchsharp.cpu.csproj" --configfile "c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\vwsqrkhn.ye1\AutoMLService\RuntimeManager\NuGet.config" -r win-x64 /p:UsingToolXliff=false /p:TorchSharpVersion=0.101.5 /p:TorchSharpCudaRuntimeVersion=2.1.0.1 /p:TensorflowRuntimeVersion=2.3.1 /p:BaseIntermediateOutputPath="C:\Users\xxx\AppData\Local\ModelBuilder\torchsharp-cpu-0.101.5\obj"
publish "c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\vwsqrkhn.ye1\AutoMLService\RuntimeManager\torchsharp.cpu.csproj" -r win-x64 -c Release --no-self-contained -o "C:\Users\xxx\AppData\Local\ModelBuilder\torchsharp-cpu-0.101.5" --no-restore /p:UsingToolXliff=false /p:TorchSharpVersion=0.101.5 /p:TorchSharpCudaRuntimeVersion=2.1.0.1 /p:TensorflowRuntimeVersion=2.3.1 /p:BaseOutputPath="C:\Users\xxx\AppData\Local\ModelBuilder\torchsharp-cpu-0.101.5\bin\\" /p:BaseIntermediateOutputPath="C:\Users\xxx\AppData\Local\ModelBuilder\torchsharp-cpu-0.101.5\obj\\"
start installing runtime in C:\Users\xxx\AppData\Local\ModelBuilder\torchsharp-cpu-0.101.5
  正在判斷要還原的專案...
C:\Program Files\dotnet\sdk\5.0.301\NuGet.targets(131,5): error : 無法載入來源 https://api.nuget.org/v3/index.json 的服務索引。 [c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\vwsqrkhn.ye1\AutoMLService\RuntimeManager\torchsharp.cpu.csproj]
C:\Program Files\dotnet\sdk\5.0.301\NuGet.targets(131,5): error :   連線嘗試失敗,因為連線對象有一段時間並未正確回應,或是連線建立失敗,因為連線的主機無法回應。 (api.nuget.org:443) [c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\vwsqrkhn.ye1\AutoMLService\RuntimeManager\torchsharp.cpu.csproj]
C:\Program Files\dotnet\sdk\5.0.301\NuGet.targets(131,5): error :   連線嘗試失敗,因為連線對象有一段時間並未正確回應,或是連線建立失敗,因為連線的主機無法回應。 [c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\vwsqrkhn.ye1\AutoMLService\RuntimeManager\torchsharp.cpu.csproj]
clean up

What runtime package failed to install? Is there a way to manually install it to solve this problem so that I can continue the training process? Thanks.

LittleLittleCloud commented 3 months ago

From the log it seems that the error is because the access to nuget.org server fails. Can you double check if you can visit the following link

https://api.nuget.org/v3/index.json

The output log shows the command to install runtime where you can mannually copy and paste in command window to install runtime manually. If you share the output log file here I can point you to the two command. But you still need access to nuget.org in order to run those command though

jalin168 commented 3 months ago

Using a web browser, I can connect to https://api.nuget.org/v3/index.json, as shown below. 08_QA_01_visit nuget json ok

My output log file is as follows. (Confidential information is replaced with "xxx".) ObjectDetection-NBAZQS.txt

Please help provide manual installation commands. In addition, can the command be posted to "Developer Command Prompt for VS 2019" and executed directly? Thank you. 08_QA_02_cmd tool

LittleLittleCloud commented 3 months ago

@jalin168

You can manually install runtime by running the following commands (you probably need to swap user name from xxx back to actual name)

dotnet restore "c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\vwsqrkhn.ye1\AutoMLService\RuntimeManager\torchsharp.cpu.csproj" --configfile "c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\vwsqrkhn.ye1\AutoMLService\RuntimeManager\NuGet.config" -r win-x64 /p:UsingToolXliff=false /p:TorchSharpVersion=0.101.5 /p:TorchSharpCudaRuntimeVersion=2.1.0.1 /p:TensorflowRuntimeVersion=2.3.1 /p:BaseIntermediateOutputPath="C:\Users\xxx\AppData\Local\ModelBuilder\torchsharp-cpu-0.101.5\obj"

dotnet publish "c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\vwsqrkhn.ye1\AutoMLService\RuntimeManager\torchsharp.cpu.csproj" -r win-x64 -c Release --no-self-contained -o "C:\Users\xxx\AppData\Local\ModelBuilder\torchsharp-cpu-0.101.5" --no-restore /p:UsingToolXliff=false /p:TorchSharpVersion=0.101.5 /p:TorchSharpCudaRuntimeVersion=2.1.0.1 /p:TensorflowRuntimeVersion=2.3.1 /p:BaseOutputPath="C:\Users\xxx\AppData\Local\ModelBuilder\torchsharp-cpu-0.101.5\bin\\" /p:BaseIntermediateOutputPath="C:\Users\xxx\AppData\Local\ModelBuilder\torchsharp-cpu-0.101.5\obj\\"
jalin168 commented 3 months ago

(Confidential information is replaced with "xxx".)

I executed the first dotnet restore command, but the following error still occurred:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>dotnet restore "c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\vwsqrkhn.ye1\AutoMLService\RuntimeManager\torchsharp.cpu.csproj" --configfile "c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\vwsqrkhn.ye1\AutoMLService\RuntimeManager\NuGet.config" -r win-x64 /p:UsingToolXliff=false /p:TorchSharpVersion=0.101.5 /p:TorchSharpCudaRuntimeVersion=2.1.0.1 /p:TensorflowRuntimeVersion=2.3.1 /p:BaseIntermediateOutputPath="C:\Users\xxx\AppData\Local\ModelBuilder\torchsharp-cpu-0.101.5\obj"
  正在判斷要還原的專案...
C:\Program Files\dotnet\sdk\5.0.301\NuGet.targets(131,5): error : 無法載入來源 https://api.nuget.org/v3/index.json 的服 務索引。 [c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\vwsqrkhn.ye1\AutoMLService\RuntimeManager\torchsharp.cpu.csproj]
C:\Program Files\dotnet\sdk\5.0.301\NuGet.targets(131,5): error :   連線嘗試失敗,因為連線對象有一段時間並未正確回應,或是連線建立失敗,因為連線的主機無法回應。 (api.nuget.org:443) [c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\vwsqrkhn.ye1\AutoMLService\RuntimeManager\torchsharp.cpu.csproj]
C:\Program Files\dotnet\sdk\5.0.301\NuGet.targets(131,5): error :   連線嘗試失敗,因為連線對象有一段時間並未正確回應,或是連線建立失敗,因為連線的主機無法回應。 [c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\vwsqrkhn.ye1\AutoMLService\RuntimeManager\torchsharp.cpu.csproj]

I guessed it was a proxy problem, so I added the proxy settings to C:\Users\xxx\AppData\Roaming\NuGet\NuGet.Config as follows:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <config>
    <add key="http_proxy" value="http://xxx.xxx.xxx:3128" />
    <add key="http_proxy.user" value="xxx" />
    <add key="http_proxy.password" value="xxx" />
  </config>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
  <disabledPackageSources>
    <add key="Microsoft and .NET" value="true" />
  </disabledPackageSources>
</configuration>

After executing the command again, a new error occurs as follows:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>dotnet restore "c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\vwsqrkhn.ye1\AutoMLService\RuntimeManager\torchsharp.cpu.csproj" --configfile "c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\vwsqrkhn.ye1\AutoMLService\RuntimeManager\NuGet.config" -r win-x64 /p:UsingToolXliff=false /p:TorchSharpVersion=0.101.5 /p:TorchSharpCudaRuntimeVersion=2.1.0.1 /p:TensorflowRuntimeVersion=2.3.1 /p:BaseIntermediateOutputPath="C:\Users\xxx\AppData\Local\ModelBuilder\torchsharp-cpu-0.101.5\obj"
  正在判斷要還原的專案...
C:\Program Files\dotnet\sdk\5.0.301\NuGet.targets(131,5): error : 無法載入來源 https://api.nuget.org/v3/index.json 的服 務索引。 [c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\vwsqrkhn.ye1\AutoMLService\RuntimeManager\torchsharp.cpu.csproj]
C:\Program Files\dotnet\sdk\5.0.301\NuGet.targets(131,5): error :   The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. [c:\program files (x86)\microsoft visual studio\2019\professional\common7\ide\extensions\vwsqrkhn.ye1\AutoMLService\RuntimeManager\torchsharp.cpu.csproj]