I'm integrating WindowsML neural network inference into a project targeting Windows 10 (Windows SDK version 17134).
Loading model from file works fine, as well as other inference steps.
But loading model from stream consistently throws hresult_not_implemented
exception (using C++/WinRT) or "The method or operation is not implemented." exception (using C#).
C# code:
using Windows.AI.MachineLearning.Preview;
// ...
// LoadModelFromStorageFileAsync works fine
var learningModel = await LearningModelPreview.LoadModelFromStorageFileAsync(file);
// .....
// LoadModelFromStreamAsync throws "not implemented" exception:
var stream = Windows.Storage.Streams.RandomAccessStreamReference.CreateFromFile(file);
var learningModel = await LearningModelPreview.LoadModelFromStreamAsync(stream);
Is that a known issue for 17134 version of Windows SDK, or this method supposed to work? Did not find any limitation info in the docs linked.
Any help or information will be very appreciated. Thanks!
P.S. I'm aware that Windows.AI.MachineLearning.Preview namespace is deprecated since Windows SDK 17763, but my current limitation is 17134 version, so I'm forced to use Preview.
Yes. In that version of the API it did not implement loading from a stream.
In your scenario can you get your stream converted to a IStorageFile ?