WongKinYiu / PyTorch_YOLOv4

PyTorch implementation of YOLOv4
1.87k stars 585 forks source link

is invalid for input of size #358

Open CoderTylor opened 3 years ago

CoderTylor commented 3 years ago

I change the label number to 6, and it goes at : return forward_call(*input, *kwargs) File "/home/tylor/nvme_guazai/yolov3_arrow/yolov4/PyTorch_YOLOv4-master/models/models.py", line 293, in forward return self.forward_once(x) File "/home/tylor/nvme_guazai/yolov3_arrow/yolov4/PyTorch_YOLOv4-master/models/models.py", line 345, in forward_once yolo_out.append(module(x, out)) File "/home/tylor/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl return forward_call(input, **kwargs) File "/home/tylor/nvme_guazai/yolov3_arrow/yolov4/PyTorch_YOLOv4-master/models/models.py", line 243, in forward p = p.view(bs, self.na, self.no, self.ny, self.nx).permute(0, 1, 3, 4, 2).contiguous() # prediction RuntimeError: shape '[4, 3, 11, 13, 13]' is invalid for input of size 172380

not known why for that

WongKinYiu commented 3 years ago

https://github.com/AlexeyAB/darknet#how-to-train-to-detect-your-custom-objects

you have to change number of filters of convolutional layers before yolo layers.