How can I remove .ipynb checkpoints from my data folder?

Hello,
I am trying to use the Pytorch 1.8 notebooks(this one doesn’t have the persisten /storage) and I have loaded all my data into a folder named liG. It contains 4 folders named one, two, lights_on and lights_off.
However, when I call the path to this directory .ipynb checkpoints is also shown as part of it:

img_path = ‘liG’
path = os.listdir(img_path)
imgpath = Path(img_path)
Path.BASE_PATH = path
os.listdir(imgpath)

I get the output:

[‘one’, ‘light_on’, ‘two’, ‘light_off’, ‘.ipynb_checkpoints’]

It is interfering with my model training and forcing me to get :

RuntimeError: CUDA error: device-side assert triggered

Which, from what I’ve read, happens when your output and label numbers do not match. I set my model output numbers to 4 categories, but it seems like ‘ipynb checkpoints’ is coming in as a 5th.
How can I remove it? Is there a better method to bring data from my liG directory into the notebook space?

I’ve done some investigation, you could run this command on a Terminal within rm -rf find -type d -name .ipynb_checkpoints to remove the checkpoints. Let me know if that works!