Probably you are on the right lead.
I removed this line:
ImageFile.LOAD_TRUNCATED_IMAGES = True

And I got this error:
Traceback (most recent call last):
 File "/.../train.py", line 192, in <module>
   train_loss, train_acc = train(epoch)
 File "/.../train.py", line 28, in train
   for batch_idx, (img, gt) in enumerate(train_loader):
 File "/.../venv/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 281, in __next__
   return self._process_next_batch(batch)
 File "/...e/venv/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 301, in _process_next_batch
   raise batch.exc_type(batch.exc_msg)
OSError: Traceback (most recent call last):
 File "/.../venv/lib/python3.6/site-packages/PIL/ImageFile.py", line 215, in load
   s = read(self.decodermaxblock)
 File "/.../venv/lib/python3.6/site-packages/PIL/PngImagePlugin.py", line 619, in load_read
   cid, pos, length = self.png.read()
 File "/.../venv/lib/python3.6/site-packages/PIL/PngImagePlugin.py", line 114, in read
   length = i32(s)
 File "/.../venv/lib/python3.6/site-packages/PIL/_binary.py", line 76, in i32be
   return unpack(">I", c[o:o+4])[0]
struct.error: unpack requires a buffer of 4 bytes

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "/.../venv/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 55, in _worker_loop
   samples = collate_fn([dataset[i] for i in batch_indices])
 File "/.../venv/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 55, in <listcomp>
   samples = collate_fn([dataset[i] for i in batch_indices])
 File "/.../data.py", line 41, in __getitem__
   sample = self.transform(sample)
 File "/.../transforms.py", line 584, in __call__
   sample = t(sample)
 File "/.../transforms.py", line 1074, in __call__
   img = transform(img)
 File "/.../transforms.py", line 584, in __call__
   sample = t(sample)
 File "/.../transforms.py", line 794, in __call__
   return self.lambd(img)
 File "/.../transforms.py", line 1048, in <lambda>
   transforms.append(Lambda(lambda img: adjust_contrast(img, contrast_factor)))
 File "/.../transforms.py", line 462, in adjust_contrast
   enhancer = ImageEnhance.Contrast(img)
 File "/.../venv/lib/python3.6/site-packages/PIL/ImageEnhance.py", line 66, in __init__
   mean = int(ImageStat.Stat(image.convert("L")).mean[0] + 0.5)
 File "/.../venv/lib/python3.6/site-packages/PIL/Image.py", line 879, in convert
   self.load()
 File "/.../venv/lib/python3.6/site-packages/PIL/ImageFile.py", line 220, in load
   raise IOError("image file is truncated")
OSError: image file is truncated