naoto0804 / SynShadow

Learning from Synthetic Shadows for Shadow Detection and Removal [Inoue and Yamasaki, IEEE TCSVT 2021].
MIT License
86 stars 14 forks source link

why this error is happening #17

Closed s2g7a03 closed 1 year ago

s2g7a03 commented 1 year ago

Traceback (most recent call last): File "train.py", line 29, in for i, data_i in enumerate(dataloader, start=iter_counter.epoch_iter): File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/dataloader.py", line 628, in next data = self._next_data() File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/dataloader.py", line 1333, in _next_data return self._process_data(data) File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/dataloader.py", line 1359, in _process_data data.reraise() File "/usr/local/lib/python3.8/dist-packages/torch/_utils.py", line 543, in reraise raise exception IndexError: Caught IndexError in DataLoader worker process 0. Original Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop data = fetcher.fetch(index) File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/_utils/fetch.py", line 58, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/_utils/fetch.py", line 58, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/content/SynShadow/src/data/synth_dataset.py", line 44, in getitem mask_index = next(self.mask_iter) File "/content/SynShadow/src/data/util.py", line 9, in InfiniteSampler yield order[i] IndexError: index -1 is out of bounds for axis 0 with size 0

naoto0804 commented 1 year ago

I guess the dataset directory (set by --dataset_root) is not correctly specified. Since there are many types of files (shadow, shadow-free, mask). Please refer datasets#file-organization and strictly follow the instruction. If it doesn't solve your situation. Let me know (with some detailed info. on execution, such as where the script is launched)

naoto0804 commented 1 year ago

Thank you! Hmm.. I had tried some typical mistakes but did not reproduce the errors above. Could you attach the entire log (in a single file) and show the actual commands to launch the train.py?

naoto0804 commented 1 year ago

Have you downloaded our SynShadow dataset as instructed?

naoto0804 commented 1 year ago

Just clicking the link may not 'work' but you might copy the link address. I can download it now by

wget http://www.hal.t.u-tokyo.ac.jp/~inoue/projects/synthetic_shadow/SynShadow.zip

If this or alternative commands do not work, let me know

naoto0804 commented 1 year ago

This part does the composition. Please read the file carefully and try to get what you want. I'm busy and may not answer questions that cost too much time to understand or inspect, especially if they seem to be asked before thinking on your own; sorry in advance.