I am using ML.NET to import an ONNX model to do object detection. For the record, I exported the model from the CustomVision.ai site from Microsoft.
I inspected the model file in Netron and it clearly shows the input node as being named "data" and the output being named "model_outputs0".
However, when I try to run this line of code to apply the ONNX model
var pipeline = mlContext.Transforms.ApplyOnnxModel(modelFile: modelLocation, outputColumnNames: new[] { "model_outputs0" }, inputColumnNames: new[] { "data" }, gpuDeviceId: 0, fallbackToCpu: true);
// Fit scoring pipeline
var model = pipeline.Fit(data);
I get the following error:
Could not find input column 'data' Parameter name: inputSchema
Which clearly says that it cannot find the input column of data, even though I clearly see that is the name in Netron, as you can see:
Now, here is the part I really don't understand. When I was trying other output names, it has a different error which basically tells me it should actually be data:
Parameter name: Input tensor, image, does not exist in the ONNX model. Available input names are [data]. Actual value was image.