microsoft / Windows-Machine-Learning

Samples and Tools for Windows ML.
https://docs.microsoft.com/en-us/windows/ai/
MIT License
1.03k stars 446 forks source link

LearningModelSession failed on Win32 on Windows 19041 build #360

Closed aisnote closed 3 years ago

aisnote commented 4 years ago

I'm submitting a…

Works well on 18362, 17663 build. But failed on 19041 build.

Current behavior

Expected behavior

Minimal reproduction of the problem with instructions

Environment

Windows Build Number: 19041

App min and target version: 17663

OS Version (Server, IoT Core, Desktop, etc): Windows10

Graphics Driver version:

DxDiag:

WinMLTools specific:

Visual Studio

call stack:

WinRT_AI_ObjectDetection.exe!winrt::impl::consume_Windows_AI_MachineLearning_ILearningModelSessionFactorywinrt::Windows::AI::MachineLearning::ILearningModelSessionFactory::CreateFromModelOnDevice(const winrt::Windows::AI::MachineLearning::LearningModel & model, const winrt::Windows::AI::MachineLearning::LearningModelDevice & deviceToRunOn) Line 250 C++ WinRT_AI_ObjectDetection.exe!winrt::Windows::AI::MachineLearning::LearningModelSession::(const winrt::Windows::AI::MachineLearning::ILearningModelSessionFactory & f) Line 2001 C++ WinRT_AI_ObjectDetection.exe!winrt::impl::factory_cache_entrywinrt::Windows::AI::MachineLearning::LearningModelSession,winrt::Windows::AI::MachineLearning::ILearningModelSessionFactory::call<winrt::Windows::AI::MachineLearning::LearningModelSession (const winrt::Windows::AI::MachineLearning::ILearningModelSessionFactory &) &>(winrt::Windows::AI::MachineLearning::LearningModelSession::winrt::Windows::AI::MachineLearning::LearningModelSession (const winrt::Windows::AI::MachineLearning::ILearningModelSessionFactory &) & callback) Line 6175 C++ WinRT_AI_ObjectDetection.exe!winrt::impl::call_factory<winrt::Windows::AI::MachineLearning::LearningModelSession,winrt::Windows::AI::MachineLearning::ILearningModelSessionFactory,winrt::Windows::AI::MachineLearning::LearningModelSession (const winrt::Windows::AI::MachineLearning::ILearningModelSessionFactory &) >(winrt::Windows::AI::MachineLearning::LearningModelSession::winrt::Windows::AI::MachineLearning::LearningModelSession (const winrt::Windows::AI::MachineLearning::ILearningModelSessionFactory &) && callback) Line 6197 C++ WinRT_AI_ObjectDetection.exe!winrt::Windows::AI::MachineLearning::LearningModelSession::LearningModelSession(const winrt::Windows::AI::MachineLearning::LearningModel & model, const winrt::Windows::AI::MachineLearning::LearningModelDevice & deviceToRunOn) Line 2001 C++

catch (winrt::hresult_error const& ex) { winrt::hresult hr = ex.to_abi(); printf("load model from RES failed by hr = %x\n", hr); }

error = 80070057: The parameter is incorrect.

my code: session = LearningModelSession{ model, LearningModelDevice(deviceKind) };

martinb35 commented 3 years ago

@aisnote - do you have the debugger output? There's usually more helpful text in the output window. The callstack alone isn't enough to help here since any model loading issue will fail with this stack. There was a version check that was added in 19041 that may be causing this. Older version would potentially permit model versions that they didn't understand, which is why some models worked, but it couldn't be guaranteed to work so we needed to add the version check.

I'm closing because this isn't actionable as-is, but feel free to re-open if you have more data. Thanks!