ivilson / Yolov7net

Yolo Detector for .Net 8
83 stars 25 forks source link

调用异常 #3

Closed virgilKing closed 1 year ago

virgilKing commented 1 year ago

使用自己的模型报错信息: lable与训练的lable是一致的 yolov5 类文件

System.IndexOutOfRangeException HResult=0x80131508 Message=Index was outside the bounds of the array. Source=System.Private.CoreLib StackTrace: 在 System.ThrowHelper.ThrowIndexOutOfRangeException() 在 System.Span1.get_Item(Int32 index) 在 Microsoft.ML.OnnxRuntime.Tensors.DenseTensor1.GetValue(Int32 index) 在 Microsoft.ML.OnnxRuntime.Tensors.Tensor1.get_Item(ReadOnlySpan1 indices) 在 Microsoft.ML.OnnxRuntime.Tensors.Tensor1.get_Item(Int32[] indices) 在 Yolov7net.Yolov5.<>c__DisplayClass9_0.<ParseDetect>b__0(Int32 i) 在 System.Threading.Tasks.Parallel.<>c__DisplayClass19_01.b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)

使用自己的模型报错信息: lable与训练的lable是一致的 yolov7 类文件 System.IndexOutOfRangeException HResult=0x80131508 Message=Index was outside the bounds of the array. Source=System.Private.CoreLib StackTrace: 在 System.ThrowHelper.ThrowIndexOutOfRangeException() 在 System.Span1.get_Item(Int32 index) 在 Microsoft.ML.OnnxRuntime.Tensors.DenseTensor1.GetValue(Int32 index) 在 Microsoft.ML.OnnxRuntime.Tensors.Tensor1.get_Item(ReadOnlySpan1 indices) 在 Microsoft.ML.OnnxRuntime.Tensors.Tensor1.get_Item(Int32[] indices) 在 Yolov7net.Yolov7.<>c__DisplayClass6_0.<ParseDetect>b__0(Int32 i) 在 System.Threading.Tasks.Parallel.<>c__DisplayClass19_01.b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)

iwaitu commented 1 year ago

You should clone this repository and rename your weights file xxx.onnx to yolov7-tiny.onnx if your onnx file is yolov7 with nms result format or yolov7-tiny_640x640.onnx if your onnx file is yolov5 format , then copy it to ··· [respository path]\test\Yolov7net.test\Assets ··· and run or debug the yolov7net.test project.

virgilKing commented 1 year ago

Yeah, that's what I did, but I made a mistake

iwaitu commented 1 year ago

parse your code here and i can find out what happend