Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error:IndexError: The shape of the mask [40, 40] at index 0 does not match the shape of the indexed tensor [80, 40, 40] at index 0 #25

Open
qwert1887 opened this issue Mar 30, 2024 · 1 comment

Comments

@qwert1887
Copy link

qwert1887 commented Mar 30, 2024

HI,When I infer using yolov8n-face.engine,it's not work,Has anyone encountered it?Details as below:

`Traceback (most recent call last):

File "/home/admin/PycharmProjects/yolov8_face/inference_trt.py", line 360, in
face_det_results, full_frames, fps, img_size, static = pre_init(face=face, img_size=img_size)

File "/home/admin/PycharmProjects/yolov8_face/inference_trt.py", line 189, in pre_init
face_det_results.extend(face_detect(full_frames[idx:idx + yolo_batch], box=box, static=static, pads=pads, nosmooth=nosmooth))

File "/home/admin/PycharmProjects/yolov8_face/yolov8_face.py", line 122, in face_detect
face_det_results = face_detect_yolo(frames, pads=pads, nosmooth=nosmooth) # BGR2RGB for CNN face detection

File "/home/admin/PycharmProjects/yolov8_face/yolov8_face.py", line 43, in face_detect_yolo
for result in results:

File "/home/admin/miniconda3/envs/w2ltrt/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 35, in generator_context
response = gen.send(None)

File "/home/admin/PycharmProjects/yolov8_face/yolov8-face/ultralytics/yolo/engine/predictor.py", line 256, in stream_inference
self.results = self.postprocess(preds, im, im0s)

File "/home/admin/PycharmProjects/yolov8_face/yolov8-face/ultralytics/yolo/v8/detect/predict.py", line 14, in postprocess
preds = ops.non_max_suppression(preds,

File "/home/admin/PycharmProjects/yolov8_face/yolov8-face/ultralytics/yolo/utils/ops.py", line 219, in non_max_suppression
x = x[xc[xi]] # confidence
IndexError: The shape of the mask [40, 40] at index 0 does not match the shape of the indexed tensor [80, 40, 40] at index 0`

@xxzznnn
Copy link

xxzznnn commented May 18, 2024

Hi, I encountered this problem too, have you fixed it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants