I am trying to convert all images into arrays and append them to an aimag data list. But I am getting error in this that say-
UnidentifiedImageError Traceback (most recent call last)
in ()
2 for i in os.listdir§:
3 path = os.path.join(p,i)
----> 4 img = image.load_img(path)
5 print(image.img_to_array(img).shape)
6
2 frames
/usr/local/lib/python3.6/dist-packages/PIL/Image.py in open(fp, mode)
2860 warnings.warn(message)
2861 raise UnidentifiedImageError(
-> 2862 “cannot identify image file %r” % (filename if filename else fp)
2863 )
2864
UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7f04d191d678>
Here is my code-
https://colab.research.google.com/drive/1ZLQnf-O9P4KeGdSeILnc08mWtxT5NDBw?usp=sharing