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

how to train the img with size of 1920*1080 #574

Open
1-etudiant opened this issue Apr 7, 2024 · 4 comments
Open

how to train the img with size of 1920*1080 #574

1-etudiant opened this issue Apr 7, 2024 · 4 comments

Comments

@1-etudiant
Copy link

if i want to train the image with size of 1920*1080,how to change the code

@GeorgeTsio
Copy link

Did you manage to run this inference? python models.py <num_classes> <IN_IMAGE_H> <IN_IMAGE_W> <namefile(optional)>

@1-etudiant
Copy link
Author

Did you manage to run this inference? python models.py <num_classes> <IN_IMAGE_H> <IN_IMAGE_W> <namefile(optional)>

no,i want to train my model using images with size of 1920*1080,i changed my cfg.py,and the content that has been altered is:"Cfg.batch = 16,Cfg.width = 1920,Cfg.height = 1080".but it output error:
Traceback (most recent call last):
File "train.py", line 626, in
train(model=model,
File "train.py", line 379, in train
bboxes_pred = model(images)
File "/home/sh/miniconda3/envs/yolov5/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/home/sh/pytorch-YOLOv4/tool/darknet2pytorch.py", line 179, in forward
x = torch.cat((x1, x2), 1)
RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 135 but got size 136 for tensor number 1 in the list.

@GeorgeTsio
Copy link

Did you manage to run this inference? python models.py <num_classes> <IN_IMAGE_H> <IN_IMAGE_W> <namefile(optional)>

no,i want to train my model using images with size of 1920*1080,i changed my cfg.py,and the content that has been altered is:"Cfg.batch = 16,Cfg.width = 1920,Cfg.height = 1080".but it output error: Traceback (most recent call last): File "train.py", line 626, in train(model=model, File "train.py", line 379, in train bboxes_pred = model(images) File "/home/sh/miniconda3/envs/yolov5/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "/home/sh/pytorch-YOLOv4/tool/darknet2pytorch.py", line 179, in forward x = torch.cat((x1, x2), 1) RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 135 but got size 136 for tensor number 1 in the list.

Please try to run first the recommended inferences with his examples to see if there are any mistakes in his model (because I found some, especially in yolov4.pth), then try your training

@GeorgeTsio
Copy link

if i want to train the image with size of 1920*1080,how to change the code

Did you manage to do it?

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