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

run test_widerface.py failed on the model yolov7-w6 #60

Open
chichan01 opened this issue May 8, 2023 · 1 comment
Open

run test_widerface.py failed on the model yolov7-w6 #60

chichan01 opened this issue May 8, 2023 · 1 comment

Comments

@chichan01
Copy link

Namespace(weights='./yolov7-w6-face.pt', img_size=960, conf_thres=0.01, iou_thres=0.5, device='4', classes=None, agnostic_nms=False, augment=False, update=False, project='runs/detect', name='exp', exist_ok=False, line_thickness=3, hide_labels=False, hide_conf=False, kpt_label=5, save_folder='./widerface_evaluate/yolov7-w6-im960/', dataset_folder='/vol/research/project/Chan/insightface/detection/retinaface/data/retinaface/val/images/')
YOLOv5 \ufffd 198076d torch 1.11.0 CUDA:4 (GeForce GTX TITAN X, 12212.8125MB)

Fusing layers...
./anaconda3/envs/pt1_11/lib/python3.9/site-packages/torch/functional.py:568: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at /opt/conda/conda-bld/pytorch_1646755849709/work/aten/src/ATen/native/TensorShape.cpp:2228.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
Model Summary: 358 layers, 69904644 parameters, 0 gradients, 88.8 GFLOPS

Traceback (most recent call last):
File "./yolov7-face/test_widerface.py", line 135, in
detect(opt=opt)
File "./yolov7-face/test_widerface.py", line 69, in detect
pred = model(img, augment=opt.augment)[0]
File "/vol/research/project/Chan/anaconda3/envs/pt1_11/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "./yolov7-face/models/yolo.py", line 361, in forward
return self.forward_once(x, profile) # single-scale inference, train
File "./yolov7-face/models/yolo.py", line 395, in forward_once
x = m(x) # run
File "//lib/python3.9/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "./yolov7-face/models/common.py", line 419, in forward
return torch.cat(x, self.d)
RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 23 but got size 24 for tensor number 1 in the list.

I can repeat the experiment with model yolov7 but not yolov7-w6.
Would you like to tell me how to make it?

@univanxx
Copy link

univanxx commented Aug 1, 2023

Hi! I had the same problem but found that my image height and width couldn't pass the check_img_size function. Reshaping input to the required size fixed the problem.

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