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: mat1 and mat2 shapes cannot be multiplied (8x1568 and 3872x2) #1

Open
trluper opened this issue Oct 19, 2022 · 1 comment

Comments

@trluper
Copy link

trluper commented Oct 19, 2022

torch.Size([8, 1568])
Linear(in_features=3872, out_features=2, bias=True)
Traceback (most recent call last):
File "/home/wwj/SPSN/train.py", line 427, in
main()
File "/home/wwj/SPSN/train.py", line 410, in main
train(epoch, train_loader, optimizer, model, device, scheduler)
File "/home/wwj/SPSN/train.py", line 54, in train
pred, pred_ss_label, depth_pred_ss_label, pred_rely, label_rely = model(images, depths, ss_map, depth_ss_map)
File "/home/fzh/miniconda3/envs/wPy37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/fzh/miniconda3/envs/wPy37/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 166, in forward
return self.module(*inputs[0], **kwargs[0])
File "/home/fzh/miniconda3/envs/wPy37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/wwj/SPSN/model.py", line 546, in forward
reliance_4 = self.guide_selector(reliance_fused_feature) # reliance_4 : (N, 2)
File "/home/fzh/miniconda3/envs/wPy37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/wwj/SPSN/model.py", line 398, in forward
x = self.fc(x)
File "/home/fzh/miniconda3/envs/wPy37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/fzh/miniconda3/envs/wPy37/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 103, in forward
return F.linear(input, self.weight, self.bias)
File "/home/fzh/miniconda3/envs/wPy37/lib/python3.7/site-packages/torch/nn/functional.py", line 1848, in linear
return torch._C._nn.linear(input, weight, bias)
RuntimeError: mat1 and mat2 shapes cannot be multiplied (8x1568 and 3872x2)

Hi,I have encountered this problem, how can I solve it

@yuluofeiyu
Copy link

Hello, where does the nju2k dataset in val_dataset come from? Is the nju2k dataset from test_dataset the original test set?thank you

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