(Using ImageDataLoaders) - [Errno 2] No such file or directory:


Hi,
I am trying to pass this path : ‘…/Data/img/simple_images/’ into ImageDataLoaders, where inside ‘simple_images’ I have individual plant folders & each folders contains 10 plant images, unfortunately ImageDataLoaders is returning me the following error!!
Error :
FileNotFoundError: [Errno 2] No such file or directory: ‘…/Data/img/simple_images/Abelia chinensis_10.jpg’
Note : that file do exists and everytime running the cell, different img names shows up in the above error, where the ImageDataLoaders think there’s no directory, it’s like the ImageDataLoader doesn’t like it when you include a folder name in your path in the df

I hope to get a positive response from your side.

Best Regards,
Sreeloy

If the user does not pass the full path to the file (on Unix type systems this means a path that starts with a slash), the python file path is interpreted relatively to the current working directory. The current working directory usually is the directory in which you started the program. In order to make this work, the directory containing the python executable must be in the PATH, a so-called environment variable that contains directories that are automatically used for searching executables when you enter a command.

In any case, if your Python script file and your data input file are not in the same directory, you always have to specify either a relative path between them or you have to use an absolute path for one of them.

1 Like