Error with Dataset

Hello there, I’m a complete beginner. So forgive me if this is a very rudimentary issue. So I downloaded a dataset from kaggle.

Everything seems fine except there’s an unknown directory and file called “.DS_Store” that shows up when list it out on my notebook. This unknown file is not a .jpeg like the rest of my data, and it is causing the following issue “OSError: Error handling image at: data/chest-xray-pneumonia/chest_xray/train/NORMAL/.DS_Store”

Any help is greatly appreciated, thank you.

Delete the .DS_Store file in that directory. Note: it’s a hidden macOS file. How?

Create a new Jupyter notebook cell. Copy the following bash command into it and run the cell:

!rm data/chest-xray-pneumonia/chest_xray/train/NORMAL/.DS_Store

Carry on from there.

1 Like

Hello Cedric, thanks for the reply.

I followed your instructions and executed the bash command you gave me. .DS_Store still however shows up and my learn function still encounters the error. (Note - first time I executed the bash command it went through, ever since then it gives me the “rm: cannot remove ‘data/chest-xray-pneumonia/chest_xray/train/NORMAL/.DS_Store’: No such file or directory”. So I’m assuming something got deleted)

I am not a macOS user. Strange. I think you should refer to this thread that had extensively discussed about this problem for another hidden file ipynb_checkpoint. The solution should be somewhere there.

Hey Cedric,

I worked it out. The !rm command you gave me was the solution. I just had to run 4 separate lines of it. For the validation folder as well as the train folder and for the NORMAL and PNEUMONIA folders in each of them.

Thank you so much for your help.

hey richardly

can. u help also solve the problem .explain me how to get rid of the .ds_store in brief . if possible write the step to solve this indepth.this would be helpful