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

run test_widerface.py failed on the model yolov7-w6

Open chichan01 opened this issue 1 year ago • 1 comments

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?

chichan01 avatar May 08 '23 00:05 chichan01

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.

univanxx avatar Aug 01 '23 10:08 univanxx