Open mustaqimasri opened 1 year ago
There may be a mismatch between your input and what the model expects: NamedOnnxValue.CreateFromTensor("image", input)
. You can use a tool like netron to see the input name ("image"
in your case) and input shape and type. Maybe the model expects floats and you give it bytes.
This is what I got when I run the model in netron.
So meaning that my input name should be input_1 with float type, and I should amend to those lines right?
// Convert the image to a tensor
Tensor<float> input = new DenseTensor<float>(new[] { height, width, 3 });
.
.
.
NamedOnnxValue.CreateFromTensor("input_1", input)
But I got another error when I made those changes. What does it means?
Hi, I am new to onnx and still trying to understand it. I try to detect the image using the pretrained yolov3 onnx model, and did some modification on the code provided in this repository but I'm using opencvsharp instead of imagesharp. However, I'm getting this Microsoft.ML.OnnxRuntime.OnnxRuntimeException: '[ErrorCode:InvalidArgument] Invalid Feed Input Name:image' error every time I run the code.
Why does this happen and where can I amend it? Here is the full code.
using OnnxTest;
using Microsoft.ML.OnnxRuntime;
using Microsoft.ML.OnnxRuntime.Tensors;
using System;
using System.Collections.Generic;
using System.Linq;
using OpenCvSharp;
namespace OnnxTest {
}
Thank you in advance for your help 😄