Azure-Samples / Custom-Vision-ONNX-UWP

An example of how to use an ONNX model exported from the Custom Vision Cognitive Service in a UWP application.
MIT License
4 stars 4 forks source link

Error when running this sample for the first time: System.NullReferenceException #2

Closed mattwojo closed 5 years ago

mattwojo commented 6 years ago

This issue is for a:

- [x] bug report 
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

clone the repo, load the project in Visual Studio, click F5 to run, the error is immediately thrown in VS

Any log messages given by the failure

Line 128: Exception User-Unhandled "System.NullReferenceException: 'Object reference not set to an instance of an object.'" The evalOutput object is Null.

**Also, receives a warning: "The certificate specified is not valid for signing..." "Certificate file 'VisionApp_TemporaryKey.pfx' not found'".

Expected/desired behavior

App launches and opens camera for taking photos to test Custom Vision identification.

OS and Version?

Windows 10 with October Update on a Surface Book

Versions

Windows 10 v.1809, build 17758.4

mattwojo commented 6 years ago

@Blackmist -- Any suggestions?

mattwojo commented 6 years ago

*I was just told that this demo app only works with the RS4 (v. 1803, build 17134 through 17738) and that if you are using the RS5 build (v.1809, build 17738+) that you should refer to this demo app: https://github.com/Azure-Samples/cognitive-services-onnx12-customvision-sample/

Blackmist commented 6 years ago

Thanks @mattwojo I'll add a note and investigate what's needed to update for 1809 compatibility.

Blackmist commented 6 years ago

@mattwojo Can you try pulling the latest updates? It should work now with the latest Windows 10 and ONNX 1.2 models.

mattwojo commented 6 years ago

@Blackmist Just pulled the updates, but am still running into issues -- 115 Warnings, first is that "evalOutput" object receives a System.NullReferenceException. Ran this on my Surface Book 2, Windows version 1809, build 17763.104, with Visual Studio 2017, version 15.8.7.

Tried running it on my desktop machine as well, but looks like the sample is set to check for a camera and catches if it's unauthorized, but doesn't catch or no what to do if there's no camera on the device (which seems like it could be a fairly common scenario). So still a few issues.

mattwojo commented 6 years ago

image

Blackmist commented 6 years ago

@mattwojo Can you try doing a git pull origin master, or download the zip? The screenshot has the old code. New code looks like:


// Evaluate the input data
var evalOutput = await model.EvaluateAsync(input);
'''
mattwojo commented 6 years ago

Ahh -- not exactly sure what happened, but grabbed the latest (and got an SDK update from 17758 to 17763) -- now it's working great. :) Thanks!

Blackmist commented 5 years ago

fixed