BobLd / YOLOv4MLNet

Use the YOLO v4 and v5 (ONNX) models for object detection in C# using ML.Net
MIT License
79 stars 31 forks source link

ArgumentException on Line 68 of Program.cs #7

Closed dstampher closed 3 years ago

dstampher commented 3 years ago

Cloned this repo, downloaded the yolov4.onnx model, changed the modelPath field to the location of the onnx file, ran the project and encountered an ArgumentException on Line 68 of Program.cs when processing kite_416.jpg. If I remove that file name from Line 63, execution works just fine. Strange.

@BobLd

Here is the Stack Trace:

at System.Drawing.Image.get_Height() at Microsoft.ML.Transforms.Image.ImageResizingTransformer.Mapper.<>cDisplayClass3_0.b1(Bitmap& dst) at Microsoft.ML.Transforms.Image.ImagePixelExtractingTransformer.Mapper.<>cDisplayClass5_0`1.b1(VBuffer1& dst) at Microsoft.ML.Transforms.Onnx.OnnxTransformer.Mapper.NamedOnnxValueGetterVec1.GetNamedOnnxValue() at Microsoft.ML.Transforms.Onnx.OnnxTransformer.Mapper.UpdateCacheIfNeeded(Int64 position, INamedOnnxValueGetter[] srcNamedOnnxValueGetters, String[] activeOutputColNames, OnnxRuntimeOutputCacher outputCache) at Microsoft.ML.Transforms.Onnx.OnnxTransformer.Mapper.<>cDisplayClass12_01.<MakeTensorGetter>b__0(VBuffer1& dst) at Microsoft.ML.Data.TypedCursorable1.TypedRowBase.<>c__DisplayClass8_01.b0(TRow row) at Microsoft.ML.Data.TypedCursorable1.TypedRowBase.FillValues(TRow row) at Microsoft.ML.Data.TypedCursorable1.RowImplementation.FillValues(TRow row) at Microsoft.ML.PredictionEngineBase2.FillValues(TDst prediction) at Microsoft.ML.PredictionEngine2.Predict(TSrc example, TDst& prediction) at Microsoft.ML.PredictionEngineBase`2.Predict(TSrc example) at YOLOv4MLNet.Program.Main() in C:\Users\david\Projects\YOLOv4MLNet-master\YOLOv4MLNet\Program.cs:line 68

dstampher commented 3 years ago

This seems to only be occurring on the iteration of the foreach loop (Line 63) for kite_416.jpg, when I remove that from being processed, execution works fine. Strange.

BobLd commented 3 years ago

Hi @dstampher, thanks for your message. This is indeed a known issue and I have created https://github.com/dotnet/machinelearning/issues/5469 to report it. I used this repos to demonstrate the error, and unfortunately it seems the bug is still therr