A couple of my recent articles were about machine learning and image classification in C#. These posts were the results of a pet project on which I was working. I will be speaking about this project at a couple of events in the coming weeks.
Get all prediction scores from your ONNX model with ML.NET
Recently I wrote an article about getting all prediction scores from your ML.NET model. So, when we want to do this for an ONNX model we have loaded with ML.NET, that should work the same, right?
Not really. Depending on the version of ML.NET, the data types of the downloaded Azure Custom Vision ONNX model are very hard to map on the .NET data types we use.
In this article I will show how we can get the labels and scores from an ONNX model prediction in C#.
Get all prediction scores from your ML.NET model
When predicting with an ML.NET model you trained yourself, you might be interested in just more than the highest scoring label. But how do you get the other labels and their corresponding scores?
In this article I will show how to you can get these values.
YAML properties as Scalar or Sequence? Or both?!
YAML is a data serialization standard that is intended to be human friendly. For example, it reduces the use of delimiters quite drastically compared to other formats like JSON.
Some YAML file authors might push the boundary for readability even further by having a property
where the value can be a sequence
with zero or more values,
or just a scalar
if there is only a single value.
Reducing the number of delimiters someone must read or write even further.
How can this work with C#, a strongly typed language?
When your ML.NET training data does not fit: ‘The asynchronous operation has not completed’
When you have created a machine learning model, you will retrain that model when new data is available. But when I recently added a couple of images to the training set of my own ML.NET model, I was faced with the following exception:
System.InvalidOperationException: 'The asynchronous operation has not completed.'
The application did work for weeks, so what has changed? And more importantly, how to fix this situation?