openai / glow

Code for reproducing results in "Glow: Generative Flow with Invertible 1x1 Convolutions"
https://arxiv.org/abs/1807.03039
MIT License
3.12k stars 516 forks source link

A bug in get_data.py #101

Open LeeDoYup opened 4 years ago

LeeDoYup commented 4 years ago

I tried to use MS-COCO dataset for training. After i serialize the MS-COCO image using

img = tf.gfile.FastGFile(img_path, 'rb').read()
or
img = open(img_path, 'rb').read()

and save tfrecords,

i always meets an error, the shape of decoded image is not corresponded to its original shape.

When i change this tf.decode_raw into tf.io.decode_image i solve the problem. https://github.com/openai/glow/blob/eaff2177693a5d84a1cf8ae19e8e0441715b82f8/data_loaders/get_data.py#L19

I manually check that bytes files have smaller size than the original size (hxwxc) What is the reason???