Skip to content

OSError: cannot identify image file <_io.BytesIO object at 0x7fc87f2ec678> #43

Open
@checongcong

Description

@checongcong

I'm following the Example Use: A building detector with TensorFlow API, and ran into an error when trying to generate the training/eval data.

System information

** What is the top-level directory of the model you are using: **
~/tensorflow/models/research/object_detection

OS Platform and Distribution: Linux Ubuntu 16.04, Elementary OS

TensorFlow installed from (source or binary): pip install tensorflow-gpu

TensorFlow version: v1.5.0

Python version: v3.6.0

CUDA/cuDNN version: CUDA 9.0, cudnn 7.0, nVidia driver: 384.111

GPU: nVidia GeForce GTX 1070 Ti 8GB memory

CPU: Intel x86-64 Intel Core i5-6400K @ 2.70GHz x 4, 16GB memory

Exact command to reproduce:

python tf_record_generation.py --label_input=labels.npz              --train_rd_path=data/train_buildings.record              --test_rd_path=data/test_buildings.record

Sample code / logs:

python tf_record_generation.py --label_input=labels.npz              --train_rd_path=data/train_buildings.record              --test_rd_path=data/test_buildings.record
You have 221 training tiles and 144 test tiles ready
Traceback (most recent call last):
  File "tf_record_generation.py", line 172, in <module>
    tf.app.run()
  File "/home/xban/.pyenv/versions/general/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 124, in run
    _sys.exit(main(argv))
  File "tf_record_generation.py", line 143, in main
    tf_example = create_tf_example(group, train_dir)
  File "tf_record_generation.py", line 56, in create_tf_example
    image = Image.open(encoded_jpg_io)
  File "/home/xban/.pyenv/versions/general/lib/python3.6/site-packages/PIL/Image.py", line 2572, in open
    % (filename if filename else fp))
OSError: cannot identify image file <_io.BytesIO object at 0x7fc87f2ec678>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions