Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError: unrecognized data stream contents when reading image file #76

Open
bhadreshpsavani opened this issue Aug 17, 2022 · 0 comments

Comments

@bhadreshpsavani
Copy link

While model training on custom data i got this error

Traceback (most recent call last):
  File "/notebooks/photo2cartoon/train.py", line 84, in <module>
    main()
  File "/notebooks/photo2cartoon/train.py", line 75, in main
    gan.train()
  File "/notebooks/photo2cartoon/models/UGATIT_sadalin_hourglass.py", line 178, in train
    real_A, _ = trainA_iter.next()
  File "/usr/local/lib/python3.9/dist-packages/torch/utils/data/dataloader.py", line 652, in __next__
    data = self._next_data()
  File "/usr/local/lib/python3.9/dist-packages/torch/utils/data/dataloader.py", line 692, in _next_data
    data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
  File "/usr/local/lib/python3.9/dist-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/usr/local/lib/python3.9/dist-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/notebooks/photo2cartoon/dataset.py", line 66, in __getitem__
    sample = self.loader(path)
  File "/notebooks/photo2cartoon/dataset.py", line 99, in default_loader
    return pil_loader(path)
  File "/notebooks/photo2cartoon/dataset.py", line 95, in pil_loader
    return img.convert('RGB')
  File "/usr/local/lib/python3.9/dist-packages/PIL/Image.py", line 934, in convert
    self.load()
  File "/usr/local/lib/python3.9/dist-packages/PIL/ImageFile.py", line 276, in load
    raise_oserror(err_code)
  File "/usr/local/lib/python3.9/dist-packages/PIL/ImageFile.py", line 71, in raise_oserror
    raise OSError(message + " when reading image file")
OSError: unrecognized data stream contents when reading image file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant