Text-to-Image-Synthesis
Text-to-Image-Synthesis copied to clipboard
cannot identify image file <_io.BytesIO object at 0x7f2d80b2e770>
Thanks for your contribution! But when I run the code, an error occurs:
Traceback (most recent call last):
File "runtime.py", line 42, in
My Pillow version is 5.1.0, and it seems like something related to the version. Could anyone help me out?
Were you able to fix this? I'm facing the same issue.
I modified 'data=np.void(img)' in convert_cub_to_hd5_script.py(line 63) to 'data=np.array(img)', and reinstall the pil, then it works. I think the problem is related to the content of 'right_image' in hdf5 file. You can run a simple test on your hdf5 file:
dataset = h5py.File(PATH_TO_HDF5FILE, 'r') # PATH_TO_HDF5FILE is the path of birds.hdf5 dataset_keys = [str(k) for k in dataset['train'].keys()] example_name = self.dataset_keys[0] example = self.dataset['train'][example_name] byte_image = bytes(np.array(example['img'])) image = Image.open(io.BytesIO(byte_image)) image.show()
Hope it can help
I had the same question. But bug disappears when I use python3.5.
Run the code in python3.
Were you able to fix this? I'm facing the same issue