yolov5-face icon indicating copy to clipboard operation
yolov5-face copied to clipboard

IndexError: index 85 is out of bounds for dimension 0 with size 85

Open ozayr opened this issue 2 years ago • 8 comments

Hi ,

getting the following error when running detect_face.py using yolov5s weights

yolov5-face/models/yolo.py", line 88, in forward y[..., class_range] = x[i][..., class_range].sigmoid() IndexError: index 85 is out of bounds for dimension 0 with size 85

tried with PyTorch 1.12 and 1.8 with python3.8 both have same error.

I have added the following code

print(class_range)
print(y.shape)
print(len(x))
print(x[0].shape)
print(i)
y[..., class_range] = x[i][..., class_range].sigmoid()

for which I get the following output

//class range [0, 1, 2, 3, 4, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94] //y.shape torch.Size([1, 3, 48, 80, 85]) //len(x) 3 //x[0].shape torch.Size([1, 3, 48, 80, 85]) //i 0

ozayr avatar Sep 29 '22 14:09 ozayr

hi,

could you please share weights with me ?

thanks

On Thu, 29 Sept 2022 at 17:17, Ozayr Moorad @.***> wrote:

Hi ,

getting the following error when running detect_face.py using yolov5s weights

yolov5-face/models/yolo.py", line 88, in forward y[..., class_range] = x[i][..., class_range].sigmoid() IndexError: index 85 is out of bounds for dimension 0 with size 85

tried with PyTorch 1.12 and 1.8 with python3.8 both have same error.

I have added the following code

print(class_range) print(y.shape) print(len(x)) print(x[0].shape) print(i) y[..., class_range] = x[i][..., class_range].sigmoid()

for which I get the following output

//class range [0, 1, 2, 3, 4, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94] //y.shape torch.Size([1, 3, 48, 80, 85]) //len(x) 3 //x[0].shape torch.Size([1, 3, 48, 80, 85]) //i 0

— Reply to this email directly, view it on GitHub https://github.com/deepcam-cn/yolov5-face/issues/204, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB24H3OM5TV4FRGY5RY3YLDWAWQJNANCNFSM6AAAAAAQY2KOBY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

synchrony10 avatar Sep 29 '22 14:09 synchrony10

Hi,

Yes there wights I'm using are the exact weights that the bash script downloads in the weights folder here: https://github.com/deepcam-cn/yolov5-face/tree/master/weights

ozayr avatar Sep 29 '22 14:09 ozayr

Hello!!

Are you still having this issue? I got this exact same error, but in my case I'm using two models, one for people tracking and this one for face detection, my issue happens because when the face tracking calls the model, it goes through the python3.6 torch package and somehow when it returns it runs the code in the face detection module, I have no idea what's going on, but I think the sys.path.insert(0, "PATH.../yolov5-face" has something to do with it while running the people tracking.

ramosrafh avatar Oct 04 '22 19:10 ramosrafh

did it solved, I was trooped here too

ggamaz avatar Nov 11 '22 03:11 ggamaz

Did you solve it? I'm dealing with the same error here. using python 3.10.6

camilotorron avatar Jul 19 '23 10:07 camilotorron

Same for me

gdiasbruno avatar Aug 15 '23 06:08 gdiasbruno

when i use yolo5s.pt as weight i get the same problem, but it is fine when you use other weights

yanggestars avatar Sep 24 '23 11:09 yanggestars