lightweight-gan icon indicating copy to clipboard operation
lightweight-gan copied to clipboard

PIL.UnidentifiedImageError exception handling for corrupted images

Open quickgrid opened this issue 3 years ago • 0 comments

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,

quickgrid avatar Nov 23 '21 04:11 quickgrid