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

RuntimeError: shape '[2, 3, 9, 80, 80]' is invalid for input of size 230400 #431

Open
EngrNaeemRaza opened this issue Jun 1, 2023 · 1 comment

Comments

@EngrNaeemRaza
Copy link

I am training for only 1 class and got this error.

Epoch gpu_mem box obj cls total targets img_size
0% 0/11 [00:08<?, ?it/s]
Traceback (most recent call last):
File "/content/drive/MyDrive/PhD-OBJ-1/PyTorch_YOLOv4-master/train.py", line 537, in
train(hyp, opt, device, tb_writer, wandb)
File "/content/drive/MyDrive/PhD-OBJ-1/PyTorch_YOLOv4-master/train.py", line 287, in train
pred = model(imgs) # forward
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/content/drive/MyDrive/PhD-OBJ-1/PyTorch_YOLOv4-master/models/models.py", line 465, in forward
return self.forward_once(x)
File "/content/drive/MyDrive/PhD-OBJ-1/PyTorch_YOLOv4-master/models/models.py", line 518, in forward_once
yolo_out.append(module(x, out))
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/content/drive/MyDrive/PhD-OBJ-1/PyTorch_YOLOv4-master/models/models.py", line 321, in forward
p = p.view(bs, self.na, self.no, self.ny, self.nx).permute(0, 1, 3, 4, 2).contiguous() # prediction
RuntimeError: shape '[2, 3, 9, 80, 80]' is invalid for input of size 230400

@KevinCMake
Copy link

KevinCMake commented Nov 17, 2023

check your .cfg & change filters
[convolutional]
size=1
stride=1
pad=1
filters=21 # (5+classes)*3
activation=linear

[yolo]
mask = 6,7,8
anchors = 12, 16, 19, 36, 40, 28, 36, 75, 76, 55, 72, 146, 142, 110, 192, 243, 459, 401
classes=2
num=9
jitter=.3
ignore_thresh = .7
truth_thresh = 1
random=1
scale_x_y = 1.05
iou_thresh=0.213
cls_normalizer=1.0
iou_normalizer=0.07
iou_loss=ciou
nms_kind=greedynms
beta_nms=0.6

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