microsoft / Windows-Machine-Learning

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

LearningModelPreview.LoadModelFromStorageFileAsync returning null #55

Closed leeprtc closed 6 years ago

leeprtc commented 6 years ago

What would cause LearningModelPreview.LoadModelFromStorageFileAsync to return null?

A valid StorageFile was passed as a parameter. No exception was thrown.

I'm using a model created with Azure Custom Vision service, generated using OnnxMLTools 1.2.2.0129 (according to Netron).

This worked before for me on Insider builds. I'm running this on latest Visual Studio 15.8.6 on Windows 10 build 17763.1.

kumraj commented 6 years ago

LearningModelPreview is deprecated as it was preview version as mentioned in the doc here. https://docs.microsoft.com/en-us/uwp/api/windows.ai.machinelearning.preview.learningmodelpreview

Use the non-preview version. See docs here. https://docs.microsoft.com/en-us/uwp/api/windows.ai.machinelearning

leeprtc commented 6 years ago

Thanks for the update. I was using Visual Studio auto-generated code, which was still using the preview version. May want to update the documentation to note this until Visual Studio updates its support to use the non-preview version.