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

dataset cannot return multiple values #11

Open
Yukui-1999 opened this issue Jun 29, 2024 · 0 comments
Open

dataset cannot return multiple values #11

Yukui-1999 opened this issue Jun 29, 2024 · 0 comments

Comments

@Yukui-1999
Copy link

Error occurs when I try to return multiple values of different shapes inside getitem of ffrecord.torch.Dataset
Original Traceback (most recent call last):
File "/data/anaconda3/envs/pl/lib/python3.9/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "/data/anaconda3/envs/pl/lib/python3.9/site-packages/ffrecord-1.4.0+3f6380c-py3.9-linux-x86_64.egg/ffrecord/torch/dataloader.py", line 156, in fetch
return self.collate_fn(data)
File "/data/anaconda3/envs/pl/lib/python3.9/site-packages/torch/utils/data/_utils/collate.py", line 265, in default_collate
return collate(batch, collate_fn_map=default_collate_fn_map)
File "/data/anaconda3/envs/pl/lib/python3.9/site-packages/torch/utils/data/_utils/collate.py", line 145, in collate
return elem_type([collate(samples, collate_fn_map=collate_fn_map) for samples in transposed])
File "/data/anaconda3/envs/pl/lib/python3.9/site-packages/torch/utils/data/_utils/collate.py", line 145, in
return elem_type([collate(samples, collate_fn_map=collate_fn_map) for samples in transposed])
File "/data/anaconda3/envs/pl/lib/python3.9/site-packages/torch/utils/data/_utils/collate.py", line 119, in collate
return collate_fn_map[elem_type](batch, collate_fn_map=collate_fn_map)
File "/data/anaconda3/envs/pl/lib/python3.9/site-packages/torch/utils/data/_utils/collate.py", line 162, in collate_tensor_fn
return torch.stack(batch, 0, out=out)
RuntimeError: stack expects each tensor to be equal size, but got [12, 5000] at entry 0 and [50, 256, 256] at entry 1

Does your tool only support returning one piece of data?

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