lightweight-gan
lightweight-gan copied to clipboard
PIL.UnidentifiedImageError exception handling for corrupted images
I tried training with cats and dogs dataset and got this error on an image after some progress in training,
PIL.UnidentifiedImageError: cannot identify image file '...\\Cat\\666.jpg'
Wondering if exception handling should be added at the cost of extra runtime overhead. This error was generated from,
https://github.com/lucidrains/lightweight-gan/blob/fce20938562a0cc289c915f7317722a8241abd37/lightweight_gan/lightweight_gan.py#L331
I found this same error with same dataset was mentioned here, https://discuss.pytorch.org/t/pil-unidentifiedimageerror-in-dataloader/73577,