Hello. A few days ago I reported an error, and at that time I thought it was not a problem with yolosharp,
but the issue has become more concrete and I am reporting it again.
The problem was max_det.
When I trained a detection model using the yolo26 model and set a value for max_det (the default value is 300) before training,
then exported it to ONNX, the following error occurs when performing inference with yolosharp.
If I do not provide a separate max_det value (i.e., using the default value of 300), there is no problem.
Can you check this issue?
I suspect that the problem arises because the layer changes when exporting the yolo model to ONNX.
Error Log
Index was outside the bounds of the array. at Compunet.YoloSharp.Decoders.Base.AnchorBasedBoundingBoxDecoder.Decode(MemoryTensor1 tensor) in //src/YoloSharp/Decoders/Base/AnchorBasedBoundingBoxDecoder.cs:line 10 at Compunet.YoloSharp.Decoders.DetectionDecoder.Decode(IYoloRawOutput output, Size size) in //src/YoloSharp/Decoders/DetectionDecoder.cs:line 9 at Compunet.YoloSharp.YoloPredictor.Predict[T](Image1 image, YoloConfiguration configuration) in //src/YoloSharp/Predictor/YoloPredictor.cs:line 51 at Compunet.YoloSharp.YoloPredictorExtensions.Detect(YoloPredictor predictor, Image1 image, YoloConfiguration configuration) in //src/YoloSharp/Predictor/YoloPredictorExtensions.cs:line 87 at Compunet.YoloSharp.YoloPredictorAsyncExtensions.<>c__DisplayClass22_0.b__0() in /_/src/YoloSharp/Predictor/YoloPredictorAsyncExtensions.cs:line 92 at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at OnnxInferencer.Services.YoloObjectDetectionBb.InferAsync(Byte[] bgrImage, Int32 inputWidth, Int32 inputHeight) in C:\project\davinci_repo\Davinci\OnnxInferencer\Services\YoloObjectDetectionBb.cs:line 72
Hello. A few days ago I reported an error, and at that time I thought it was not a problem with yolosharp,
but the issue has become more concrete and I am reporting it again.
The problem was max_det.
When I trained a detection model using the yolo26 model and set a value for max_det (the default value is 300) before training,
then exported it to ONNX, the following error occurs when performing inference with yolosharp.
If I do not provide a separate max_det value (i.e., using the default value of 300), there is no problem.
Can you check this issue?
I suspect that the problem arises because the layer changes when exporting the yolo model to ONNX.
Error Log
Index was outside the bounds of the array. at Compunet.YoloSharp.Decoders.Base.AnchorBasedBoundingBoxDecoder.Decode(MemoryTensor1 tensor) in //src/YoloSharp/Decoders/Base/AnchorBasedBoundingBoxDecoder.cs:line 10 at Compunet.YoloSharp.Decoders.DetectionDecoder.Decode(IYoloRawOutput output, Size size) in //src/YoloSharp/Decoders/DetectionDecoder.cs:line 9 at Compunet.YoloSharp.YoloPredictor.Predict[T](Image1 image, YoloConfiguration configuration) in //src/YoloSharp/Predictor/YoloPredictor.cs:line 51 at Compunet.YoloSharp.YoloPredictorExtensions.Detect(YoloPredictor predictor, Image1 image, YoloConfiguration configuration) in //src/YoloSharp/Predictor/YoloPredictorExtensions.cs:line 87 at Compunet.YoloSharp.YoloPredictorAsyncExtensions.<>c__DisplayClass22_0.b__0() in /_/src/YoloSharp/Predictor/YoloPredictorAsyncExtensions.cs:line 92 at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at OnnxInferencer.Services.YoloObjectDetectionBb.InferAsync(Byte[] bgrImage, Int32 inputWidth, Int32 inputHeight) in C:\project\davinci_repo\Davinci\OnnxInferencer\Services\YoloObjectDetectionBb.cs:line 72