共用方式為


檢查 Windows ML 中的執行提供者版本

Windows ML 中的大多數執行提供者會在執行時透過 Windows Update 動態取得,如 初始化執行提供者所示,而更新版本則會自動更新(並附有相容更新),如 更新執行提供者所述,這意味著 EP 的版本可能會隨時間變化。

請參閱支援的 執行提供者文件 ,了解可用的執行提供者及其發布歷史。

請查看你終端使用者的EP版本

你可以透過檢查 ExecutionProvider 上的 PackageId 屬性,程式化地檢查裝置上存在的執行提供者(EP)版本。

如果 EP 尚未出現,PackageId 會回傳 null。

// Get all EPs compatible with this device
var providers = ExecutionProviderCatalog.GetDefault().FindAllProviders();

// For each provider
foreach (var provider in providers)
{
    // Log the name
    Debug.WriteLine($"Windows ML EP: {provider.Name}");

    // Log the version
    if (provider.PackageId != null)
    {
        var v = provider.PackageId.Version;
        Debug.WriteLine($"Version: {v.Major}.{v.Minor}.{v.Build}.{v.Revision}");
    }
    else
    {
        Debug.WriteLine("Version: Not installed");
    }
}

在安裝 QNN EP 的裝置上,此代碼輸出以下內容......

Windows ML EP: QNNExecutionProvider
Version: 1.8.27.0

請查看你自己裝置的 EP 版本

你也可以用 PowerShell 輕鬆檢查開發裝置上安裝的 EP 版本。

Get-AppxPackage MicrosoftCorporationII.WinML.*

在安裝 QNN EP 的裝置上,輸出如下...

Name              : MicrosoftCorporationII.WinML.Qualcomm.QNN.EP.1.8
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : Arm64
ResourceId        :
Version           : 1.8.27.0
...

另請參閱