VITA-Group / EnlightenGAN

[IEEE TIP] "EnlightenGAN: Deep Light Enhancement without Paired Supervision" by Yifan Jiang, Xinyu Gong, Ding Liu, Yu Cheng, Chen Fang, Xiaohui Shen, Jianchao Yang, Pan Zhou, Zhangyang Wang
Other
893 stars 198 forks source link

ZeroDivisionError when running script.py with --predict #19

Closed htadashi closed 5 years ago

htadashi commented 5 years ago

Running !python scripts/script.py --predict returns the following error:

Traceback (most recent call last): File "predict.py", line 25, in for i, data in enumerate(dataset): File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 281, in next return self._process_next_batch(batch) File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 301, in _process_next_batch raise batch.exc_type(batch.exc_msg) ZeroDivisionError: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 55, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 55, in samples = collate_fn([dataset[i] for i in batch_indices]) File "/content/gdrive/My Drive/Colab Notebooks/EnlightenGAN/data/unaligned_dataset.py", line 82, in getitem B_img = self.B_imgs[index % self.B_size] ZeroDivisionError: integer division or modulo by zero

hao-qiang commented 5 years ago

Puting one image in 'test_dataset/testB' folder.

htadashi commented 5 years ago

Thanks, the problem is solved :)