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

dataloader is broken #46

Closed
syu-tan opened this issue Mar 28, 2020 · 1 comment
Closed

dataloader is broken #46

syu-tan opened this issue Mar 28, 2020 · 1 comment

Comments

@syu-tan
Copy link

syu-tan commented Mar 28, 2020

i try to do test train.py by jeans2skirt_ccp dataset.
but, mask image can't change tensor or, normalize
this error
Traceback (most recent call last):
File "train.py", line 24, in
for i, data in enumerate(dataset):
File "/home/s-yasui/src/instagan/data/init.py", line 72, in iter
for i, data in enumerate(self.dataloader):
File "/home/s-yasui/anaconda3/envs/ai/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 819, in next
return self._process_data(data)
File "/home/s-yasui/anaconda3/envs/ai/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 846, in _process_data
data.reraise()
File "/home/s-yasui/anaconda3/envs/ai/lib/python3.7/site-packages/torch/_utils.py", line 385, in reraise
raise self.exc_type(msg)
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/s-yasui/anaconda3/envs/ai/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
data = fetcher.fetch(index)
File "/home/s-yasui/anaconda3/envs/ai/lib/python3.7/site-packages/torch/utils/data/utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/s-yasui/anaconda3/envs/ai/lib/python3.7/site-packages/torch/utils/data/utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/s-yasui/src/instagan/data/unaligned_seg_dataset.py", line 71, in getitem
A_segs = self.read_segs(A_seg_path, seed)
File "/home/s-yasui/src/instagan/data/unaligned_seg_dataset.py", line 42, in read_segs
seg = self.fixed_transform(seg, seed)
File "/home/s-yasui/src/instagan/data/unaligned_seg_dataset.py", line 34, in fixed_transform
return self.transform(image)
File "/home/s-yasui/anaconda3/envs/ai/lib/python3.7/site-packages/torchvision/transforms/transforms.py", line 61, in call
img = t(img)
File "/home/s-yasui/anaconda3/envs/ai/lib/python3.7/site-packages/torchvision/transforms/transforms.py", line 166, in call
return F.normalize(tensor, self.mean, self.std, self.inplace)
File "/home/s-yasui/anaconda3/envs/ai/lib/python3.7/site-packages/torchvision/transforms/functional.py", line 217, in normalize
tensor.sub
(mean[:, None, None]).div
(std[:, None, None])
RuntimeError: output with shape [1, 300, 200] doesn't match the broadcast shape [3, 300, 200]

please help , thank you

@sangwoomo
Copy link
Owner

Hi, the code is based on old libraries (e.g., PyTorch 0.4), hence there is some compatibility problem.
I think Issue #36 would help.

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