How do I convert a directory of jpeg images to TFRecords file in tensorflow?

后端 未结 7 680
后悔当初
后悔当初 2020-11-30 17:37

I have training data that is a directory of jpeg images and a corresponding text file containing the file name and the associated category label. I am trying to convert thi

7条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-30 18:09

    In case of too much size in tfrecord files you use directly read bytes.

    This link shows it. TFrecords occupy more space than original JPEG images

    you use this function to read bytes directly.

    img_bytes = open(path,'rb').read()
    

    reference

    https://github.com/tensorflow/tensorflow/issues/9675

提交回复
热议问题