sulc / tfrecord-viewer

TFRecord Viewer for browsing contents of TFRecords with object detection/classification annotations.
Other
183 stars 45 forks source link

“IOError: image file truncated” #3

Closed njanirudh closed 4 years ago

njanirudh commented 4 years ago

Error In some cases when opening the record file the following error turns up. OSError: image file is truncated (46 bytes not processed) Solution In the file ~/tfrecord-viewer/overlays/detection_overlay.py Add the following statements to the top import io from PIL import Image, ImageDraw, ImageFont, ImageFile ImageFile.LOAD_TRUNCATED_IMAGES = True References https://stackoverflow.com/questions/12984426/python-pil-ioerror-image-file-truncated-with-big-images