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

Problem with dataloader #14

Closed
gulzainali98 opened this issue Nov 4, 2021 · 3 comments
Closed

Problem with dataloader #14

gulzainali98 opened this issue Nov 4, 2021 · 3 comments

Comments

@gulzainali98
Copy link

Traceback (most recent call last): File "train.py", line 540, in <module> main() File "train.py", line 513, in main train_data = tra_prefetcher.next() File "/home/mkhan/generic_loss/STDF-PyTorch/utils/file_io.py", line 271, in next return next(self.loader) File "/opt/conda/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in __next__ data = self._next_data() File "/opt/conda/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data return self._process_data(data) File "/opt/conda/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data data.reraise() File "/opt/conda/lib/python3.8/site-packages/torch/_utils.py", line 434, in reraise raise exception numpy.AxisError: Caught AxisError in DataLoader worker process 0. Original Traceback (most recent call last): File "/opt/conda/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop data = fetcher.fetch(index) File "/opt/conda/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/opt/conda/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/mkhan/generic_loss/STDF-PyTorch/dataset/mfqev2.py", line 102, in __getitem__ img_lq = _bytes2img(img_bytes) # (H W 1) File "/home/mkhan/generic_loss/STDF-PyTorch/dataset/mfqev2.py", line 13, in _bytes2img img = np.expand_dims(cv2.imdecode(img_np, cv2.IMREAD_GRAYSCALE), 2) # (H W 1) File "<__array_function__ internals>", line 5, in expand_dims File "/opt/conda/lib/python3.8/site-packages/numpy/lib/shape_base.py", line 597, in expand_dims axis = normalize_axis_tuple(axis, out_ndim) File "/opt/conda/lib/python3.8/site-packages/numpy/core/numeric.py", line 1385, in normalize_axis_tuple axis = tuple([normalize_axis_index(ax, ndim, argname) for ax in axis]) File "/opt/conda/lib/python3.8/site-packages/numpy/core/numeric.py", line 1385, in <listcomp> axis = tuple([normalize_axis_index(ax, ndim, argname) for ax in axis]) numpy.AxisError: axis 2 is out of bounds for array of dimension 1

@ryanxingql
Copy link
Owner

Sorry I haven't met this problem. You may need to check your LMDB data.

@gulzainali98
Copy link
Author

it would be great if the lmdb data is available and you could upload it.

@ryanxingql
Copy link
Owner

Sorry I don't have this in my PC. LMDB is almost as big as the original data-set.

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