yumingj / C2-Matching

Code for C2-Matching (CVPR2021). Paper: Robust Reference-based Super-Resolution via C2-Matching.
https://yumingj.github.io/projects/C2_matching.html
Apache License 2.0
199 stars 34 forks source link

RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. #17

Closed chenmz430 closed 2 years ago

chenmz430 commented 2 years ago

RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 332 and 375 in dimension 3 at /tmp/pip-req-build-rz55_vgo/aten/src/TH/generic/THTensor.cpp:612

Hi,I am working on Stage 3: Train Restoration Network in Train. Run into this difficulty,this problem how to solve?

chenmz430 commented 2 years ago

File "mmsr/train.py", line 189, in main() File "mmsr/train.py", line 143, in main for _, train_data in enumerate(train_loader): File "/mistgpu/miniconda/envs/c2_matching/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 345, in next data = self._next_data() File "/mistgpu/miniconda/envs/c2_matching/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 856, in _next_data return self._process_data(data) File "/mistgpu/miniconda/envs/c2_matching/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 881, in _process_data data.reraise() File "/mistgpu/miniconda/envs/c2_matching/lib/python3.7/site-packages/torch/_utils.py", line 394, in reraise raise self.exc_type(msg) RuntimeError: Caught RuntimeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/mistgpu/miniconda/envs/c2_matching/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop data = fetcher.fetch(index) File "/mistgpu/miniconda/envs/c2_matching/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch return self.collate_fn(data) File "/mistgpu/miniconda/envs/c2_matching/lib/python3.7/site-packages/torch/utils/data/_utils/collate.py", line 74, in default_collate return {key: default_collate([d[key] for d in batch]) for key in elem} File "/mistgpu/miniconda/envs/c2_matching/lib/python3.7/site-packages/torch/utils/data/_utils/collate.py", line 74, in return {key: default_collate([d[key] for d in batch]) for key in elem} File "/mistgpu/miniconda/envs/c2_matching/lib/python3.7/site-packages/torch/utils/data/_utils/collate.py", line 55, in default_collate return torch.stack(batch, 0, out=out) RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 332 and 375 in dimension 3 at /tmp/pip-req-build-rz55_vgo/aten/src/TH/generic/THTensor.cpp:612

yumingj commented 2 years ago

Hi, thanks for your interest in our work. It seems that the images in your dataset have different sizes.

chenmz430 commented 2 years ago

![Uploading 111.png…]()

chenmz430 commented 2 years ago

111 Is the data set file path I modified in STAGE3 incorrect

chenmz430 commented 2 years ago

Still appear above - mentioned problem, request answer

yumingj commented 2 years ago

dataroot_in: datasets/CUFED/input dataroot_ref: datasets/CUFED/ref

chenmz430 commented 2 years ago

谢谢,训练数据集CUFED5和wr sr的时候也是这个么

---- 回复的原邮件 ---- | 发件人 | Yuming @.> | | 日期 | 2022年01月05日 16:27 | | 收件人 | @.> | | 抄送至 | @.>、State @.> | | 主题 | Re: [yumingj/C2-Matching] RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. (Issue #17) |

dataroot_in: datasets/CUFED/input dataroot_ref: datasets/CUFED/ref

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you modified the open/close state.Message ID: @.***>

yumingj commented 2 years ago

CUFED5和wr sr只拿来做测试,不训练