Facing an Error

i am trying to code for the pokedex assignment , but i am facing an error which creatin image_data list and labels list that we store the training images and labels respectively.
CODE LINK :- https://colab.research.google.com/drive/1BVSrqlZ-fmDHphJJfd8E6YiDsVfcdLZv?usp=sharing

error screenshot ::–

Hi @saksham_thukral,
You are using the image.load_img() function to read the images but the problem is that the dataset contains image of the types .svg too whereas load_img() can’t read the svg format. e.g This image of a Fearow is of the type .svg: 8f2d7986ab76482fb76cac6a91b66de4.svg
I leave it upto you to resolve it completely (Whther you want to convert .svg to .jpg or to use a different function for loading the images).

Hope this helps!

Now i changes all other format images to ‘.jpg’ format images, but its still giving me same error, i infact ran a loop to check whether is there any file whose ‘dest’ is not ‘.jpg’ , there was just one ipynb.checkpoint file for that i used keyword continue, and copied all the images with .jpg extension in the Traain_Data folder, but it is still not working and giving the same error, plz check now what is the problem
Code link :-https://colab.research.google.com/drive/1BVSrqlZ-fmDHphJJfd8E6YiDsVfcdLZv?usp=sharing

I just went through your code. Your code is just changing the extension of non .jpg files (renaming) into .jpg. This doesn’t change their internal representation and the fact that load_img() cannot understand an svg image.

Here’s a link which gives a method to load svg images directly into a numpy array.

Hope this helps!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.