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: Given groups=1, weight of size [3, 32, 2, 2], expected input[1, 3, 256, 256] to have 32 channels, but got 3 channels instead #9

Open
108360215 opened this issue Feb 5, 2024 · 7 comments

Comments

@108360215
Copy link

My data is Gen1 data, I use command: "python train_g1.py", and I need help to solve this. could everyone help me. Thanks!

@HouNic97
Copy link

HouNic97 commented Feb 6, 2024

My data is Gen1 data, I use command: "python train_g1.py", and I need help to solve this. could everyone help me. Thanks!

Hi bro,have you already solved Problem“Train_g1.py has no dataset about .txt” AND HOW?

@108360215
Copy link
Author

@HouNic97 I replace datasets_g1T.py with give_g1_data.py(LoadImagesAndLabels). But I still can't implement train_g1.py.

@HouNic97
Copy link

@HouNic97 I replace datasets_g1T.py with give_g1_data.py(LoadImagesAndLabels). But I still can't implement train_g1.py.

Q

Thank you for your response. I don't quite understand the settings for these three paths. How did you set them, and where do I need to set them?(give_g1_data.py : line 410 ,line 440 and line 441)

@108360215
Copy link
Author

@HouNic97 Hi, I also try to figure out this source code. I am still not implementing on train_g1.py, if you work successfully pls tell me. Thanks.

@108360215
Copy link
Author

@HouNic97 I know these path should be your gen1 data file path

@ooYwY
Copy link

ooYwY commented May 15, 2024

请问这个问题解决了吗 该怎么解决呢

@sumingming123
Copy link

Have you encountered this problem? I have agreed to the time_window setting parameters. This error is still displayed.Starting training for 250 epochs...

Epoch gpu_mem box obj cls labels img_size
0%| | 0/1 [00:00<?, ?it/s] /content/drive/MyDrive/EMS_YOLO_LU/g1_resnet/train_g1.py:343: FutureWarning: torch.cuda.amp.autocast(args...) is deprecated. Please use torch.amp.autocast('cuda', args...) instead.
with amp.autocast(enabled=cuda):
0%| | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/content/drive/MyDrive/EMS_YOLO_LU/g1_resnet/train_g1.py", line 662, in
main(opt)
File "/content/drive/MyDrive/EMS_YOLO_LU/g1_resnet/train_g1.py", line 559, in main
train(opt.hyp, opt, device, callbacks)
File "/content/drive/MyDrive/EMS_YOLO_LU/g1_resnet/train_g1.py", line 344, in train
pred = model(imgs) # forward
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1747, in _call_impl
return forward_call(*args, **kwargs)
File "/content/drive/MyDrive/EMS_YOLO_LU/models/yolo.py", line 140, in forward
input[i] = x
RuntimeError: expand(torch.FloatTensor{[47, 5, 3, 320, 320]}, size=[47, 5, 3, 320]): the number of sizes provided (4) must be greater or equal to the number of dimensions in the tensor (5)

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

4 participants