yucornetto / MGMatting

This repository includes the official project of Mask Guided (MG) Matting, presented in our paper: Mask Guided Matting via Progressive Refinement Network
Other
331 stars 46 forks source link

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 3 years ago

jsjxyjl commented 3 years ago

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 commented 3 years ago

The data set problem, I solved now, thank you