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

I get an error during the run : RuntimeError: Sizes of tensors must match except in dimension 2. Got 1280 and 1925 (The offending index is 0) #19

Open
jsjxyjl opened this issue Jul 29, 2021 · 1 comment

Comments

@jsjxyjl
Copy link

jsjxyjl commented Jul 29, 2021

I get an error during the run

RuntimeError: Sizes of tensors must match except in dimension 2. Got 1280 and 1925 (The offending index is 0)

`
[07-29 17:17:55] INFO: TRAIN: 431 foreground/images are valid
[07-29 17:17:55] INFO: TEST: 1000 foreground/images are valid
.......

[07-29 17:17:58] INFO: MGMatting-DIM-100k
[07-29 17:17:58] INFO: Number of parameters: 29700587
[07-29 17:17:58] INFO: Load Imagenet Pretrained: pretrain/model_best_resnet34_En_nomixup.pth
[07-29 17:18:13] INFO: [0/100000], REC: 0.3846, COMP: 1.6605, LAP: 1.7907, lr: 0.000000
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
Traceback (most recent call last):
File "./main.py", line 110, in
main()
File "./main.py", line 78, in main
trainer.train()
File "/code/MGMatting/code-base/trainer.py", line 306, in train
pred = self.G(image, mask)
File "/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/anaconda3/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 159, in forward
return self.module(*inputs[0], **kwargs[0])
File "anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/code/MGMatting/code-base/networks/generators.py", line 24, in forward
inp = torch.cat((image, guidance), dim=1)
RuntimeError: Sizes of tensors must match except in dimension 2. Got 1280 and 1925 (The offending index is 0)

`

@jsjxyjl
Copy link
Author

jsjxyjl commented Jul 29, 2021

The data set problem, I solved now, 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

1 participant