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: The size of tensor a (28) must match the size of tensor b (76) at non-singleton dimension 3 when Image size is changed from 608 to 224 #523

Open
imihassan opened this issue Apr 29, 2022 · 4 comments

Comments

@imihassan
Copy link

Hi, I changed the image size in Cfg file to

Cfg.width = 224
Cfg.height = 224

I got the below error. I am not able to resolve it. Can you help me to find out the problem.

Epoch 1/3:   0%|           | 0/2 [00:03<?, ?img/s]
Traceback (most recent call last):
  File "train.py", line 634, in <module>
    train(model=model,
  File "train.py", line 383, in train
    loss, loss_xy, loss_wh, loss_obj, loss_cls, loss_l2 = criterion(bboxes_pred, bboxes)
  File "C:\ProgramData\Anaconda3\envs\yolov4t\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "train.py", line 249, in forward
    pred[..., 0] += self.grid_x[output_id]
RuntimeError: The size of tensor a (28) must match the size of tensor b (76) at non-singleton dimension 3
@imihassan
Copy link
Author

any suggestions?

@imihassan
Copy link
Author

I am still not able to solve this problem. Any one know this?

@pavlik-tikhomirov
Copy link

try change strides in train.py (from [8, 16, 32] to [32, 16, 8]

I am still not able to solve this problem. Any one know this?

@imihassan
Copy link
Author

try change strides in train.py (from [8, 16, 32] to [32, 16, 8]

I am still not able to solve this problem. Any one know this?

I changed but still no success.

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