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 [32, 3, 1, 1], expected input[128, 36, 207, 1] to have 3 channels, but got 1 channels instead #3

Open
Leihang999 opened this issue Nov 1, 2023 · 4 comments

Comments

@Leihang999
Copy link

Leihang999 commented Nov 1, 2023

不知道为什么一直报这个通道错误,,feature_len是按你设置的3,但是报错一直说实际数据是1
Traceback (most recent call last):
File "main.py", line 200, in
rnn_train(args, datasets, scaler)
File "main.py", line 92, in rnn_train
loss, mae, mape, rmse = trainer.train(input_data, target)
File "/root/AGC-net-main/model.py", line 742, in train
output, h = self.model(input_data)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/root/AGC-net-main/model.py", line 122, in forward
out, _ = self.forward_one(h_x)
File "/root/AGC-net-main/model.py", line 149, in forward_one
residual = F.relu(self.upsampling(x))
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 446, in forward
return self._conv_forward(input, self.weight, self.bias)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 442, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
RuntimeError: Given groups=1, weight of size [32, 3, 1, 1], expected input[128, 36, 207, 1] to have 3 channels, but got 1 channels instead

@Leihang999 Leihang999 changed the title 1111 RuntimeError: Given groups=1, weight of size [32, 3, 1, 1], expected input[128, 36, 207, 1] to have 3 channels, but got 36 channels instead Nov 1, 2023
@Leihang999 Leihang999 changed the title RuntimeError: Given groups=1, weight of size [32, 3, 1, 1], expected input[128, 36, 207, 1] to have 3 channels, but got 36 channels instead RuntimeError: Given groups=1, weight of size [32, 3, 1, 1], expected input[128, 36, 207, 1] to have 3 channels, but got 1 channels instead Nov 1, 2023
@Leihang999
Copy link
Author

什么都没动,就把数据集弄好了,然后按你的运行

@33yeah123
Copy link

不知道为什么一直报这个通道错误,,feature_len是按你设置的3,但是报错一直说实际数据是1 Traceback (most recent call last): File "main.py", line 200, in rnn_train(args, datasets, scaler) File "main.py", line 92, in rnn_train loss, mae, mape, rmse = trainer.train(input_data, target) File "/root/AGC-net-main/model.py", line 742, in train output, h = self.model(input_data) File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/root/AGC-net-main/model.py", line 122, in forward out, _ = self.forward_one(h_x) File "/root/AGC-net-main/model.py", line 149, in forward_one residual = F.relu(self.upsampling(x)) File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 446, in forward return self._conv_forward(input, self.weight, self.bias) File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 442, in _conv_forward return F.conv2d(input, weight, bias, self.stride, RuntimeError: Given groups=1, weight of size [32, 3, 1, 1], expected input[128, 36, 207, 1] to have 3 channels, but got 1 channels instead

你好,想问下那个.h5文件怎么来的

@wdlovecjy
Copy link

你好,我也遇到了这个问题
可以帮忙解决下吗,谢谢您了

@Leihang999
Copy link
Author

Leihang999 commented Jun 12, 2024 via email

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

3 participants