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

Error #3

Open
xingyezhuifeng opened this issue Aug 21, 2020 · 2 comments
Open

Error #3

xingyezhuifeng opened this issue Aug 21, 2020 · 2 comments

Comments

@xingyezhuifeng
Copy link

xingyezhuifeng commented Aug 21, 2020

tensor.sub_(mean[:, None, None]).div_(std[:, None, None])
RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 0

Could you please help me?

@albert100121
Copy link
Owner

Hi @xingyezhuifeng
Could you provide more detail?
Thank you.

@Ren-Lex
Copy link

Ren-Lex commented May 22, 2022

I have this error too.

Traceback (most recent call last):
File "main.py", line 360, in
main()
File "main.py", line 295, in main
for batch_idx, (imgU_crop, imgD_crop,
File "/home/renyibin/anaconda3/lib/python3.8/site-packages/tqdm/std.py", line 1178, in iter
for obj in iterable:
File "/home/renyibin/anaconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 345, in next
data = self._next_data()
File "/home/renyibin/anaconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 856, in _next_data
return self._process_data(data)
File "/home/renyibin/anaconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 881, in _process_data
data.reraise()
File "/home/renyibin/anaconda3/lib/python3.8/site-packages/torch/_utils.py", line 395, in reraise
raise self.exc_type(msg)
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/renyibin/anaconda3/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
data = fetcher.fetch(index)
File "/home/renyibin/anaconda3/lib/python3.8/site-packages/torch/utils/data/utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/renyibin/anaconda3/lib/python3.8/site-packages/torch/utils/data/utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/renyibin/360SD-Net/dataloader/RGB_Loader.py", line 64, in getitem
up_img = processed(up_img)
File "/home/renyibin/anaconda3/lib/python3.8/site-packages/torchvision/transforms/transforms.py", line 61, in call
img = t(img)
File "/home/renyibin/anaconda3/lib/python3.8/site-packages/torchvision/transforms/transforms.py", line 166, in call
return F.normalize(tensor, self.mean, self.std, self.inplace)
File "/home/renyibin/anaconda3/lib/python3.8/site-packages/torchvision/transforms/functional.py", line 208, in normalize
tensor.sub
(mean).div
(std)
RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 0

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