Skip to content

OSError: image file is truncated #151

Description

@ABing2002

CustomDatasetDataLoader
dataset [UnalignedDataset] was created
Traceback (most recent call last):
File "D:\miniconda\envs\python3_8\lib\site-packages\PIL\ImageFile.py", line 271, in load
s = read(self.decodermaxblock)
File "D:\miniconda\envs\python3_8\lib\site-packages\PIL\PngImagePlugin.py", line 932, in load_read
cid, pos, length = self.png.read()
File "D:\miniconda\envs\python3_8\lib\site-packages\PIL\PngImagePlugin.py", line 167, in read
length = i32(s)
File "D:\miniconda\envs\python3_8\lib\site-packages\PIL_binary.py", line 85, in i32be
return unpack_from(">I", c, o)[0]
struct.error: unpack_from requires a buffer of at least 4 bytes for unpacking 4 bytes at offset 0 (actual buffer size is 0)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "train.py", line 14, in
data_loader = CreateDataLoader(opt)
File "D:\graduate\EnlightenGAN\EnlightenGAN-master\data\data_loader.py", line 6, in CreateDataLoader
data_loader.initialize(opt)
File "D:\graduate\EnlightenGAN\EnlightenGAN-master\data\custom_dataset_data_loader.py", line 39, in initialize
self.dataset = CreateDataset(opt)
File "D:\graduate\EnlightenGAN\EnlightenGAN-master\data\custom_dataset_data_loader.py", line 29, in CreateDataset
dataset.initialize(opt)
File "D:\graduate\EnlightenGAN\EnlightenGAN-master\data\unaligned_dataset.py", line 65, in initialize
self.A_imgs, self.A_paths = store_dataset(self.dir_A)
File "D:\graduate\EnlightenGAN\EnlightenGAN-master\data\image_folder.py", line 45, in store_dataset
img = Image.open(path).convert('RGB')
File "D:\miniconda\envs\python3_8\lib\site-packages\PIL\Image.py", line 922, in convert
self.load()
File "D:\miniconda\envs\python3_8\lib\site-packages\PIL\ImageFile.py", line 278, in load
raise OSError(msg) from e
OSError: image file is truncated

i dont what's wrong. I download the dataset from the link provided by author

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions