ryanxingql / stdf-pytorch

Implementation of "Spatio-Temporal Deformable Convolution for Compressed Video Quality Enhancement" (AAAI'20).
https://www.aiide.org/ojs/index.php/AAAI/article/view/6697
Apache License 2.0
155 stars 20 forks source link

Problem with dataloader #14

Closed gulzainali98 closed 2 years ago

gulzainali98 commented 2 years ago

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 commented 2 years ago

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

gulzainali98 commented 2 years ago

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

ryanxingql commented 2 years ago

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