How to remove .ipynb checkpoint

(Gokkul Nath T S) #41

Add “.ds_store” too. Most the Mac Users will face problems with .DS_Store Files. @ecdrid Please include this change also in you pull request

if label not in (’.ipynb_checkpoints’,".ds_store" ): instead of if label not in (’.ipynb_checkpoints’):

(Merlin von Trott) #42

Going into the directory and typing “rm -r .ipynb_checkpoints/” got rid of the problem for me.

Thanks for the help

(ecdrid) #43

Sorry for late reply
Also __MACOSX Or something?

It’s already done…
Thanks and Sorry for late reply…
Kind of lost in the forum due to it’s exponential expansion

(Susant Bisoi) #44

I am using Azure Deep learning VM and connecting through GIT BAsh as terminal.I cloned the file from the

the git location as mentioned in below image

but when i start running the lession1 why the content is different than the 2018 content like below

Original Git folder contents lesson1 page details as shown below

Please let me know did i copied/cloned from wrong location.
or do we have to edit the wiki page info.
@amritv and @Chris_Palmer do u have any idea about this ?

(Chris Palmer) #45 is wrong I think…

What you want is

I wonder why that wiki page is pointing to this - either the wiki page is not for the current course, or it must be an very old reference…

(Jeremy Howard (Admin)) #46

That is the 2017 course wiki.


Complete n00b here, but this worked for me.
After lesson 1 I made a folder emmanotemma with subfolders train and valid in exactly the same way as dogs and cats in lesson 1.
I duplicated the lesson 1 notebook and that is where the error may have arisen. Again, n00b here.

Running the following code in the notebook worked for me:

!rm -r data/emmanotemma/.ipynb_checkpoints
!rm -r data/emmanotemma/valid/emma/.ipynb_checkpoints
!rm -r data/emmanotemma/train/emma/.ipynb_checkpoints
!rm -r data/emmanotemma/valid/notemma/.ipynb_checkpoints
!rm -r data/emmanotemma/train/notemma/.ipynb_checkpoints

Of course you will have to insert your own folder instead of emmanotemma and corresponding subfolders.

(Marília Dourado) #48

thanks! that works for me too :slight_smile:

(Ahmed Mohamed Mostafa Zaitoon) #49

thanks worked for me

(Vick) #50

I had the same problem and this code helped solve the issue. Thanks.
Is there a way to solve it permanently? I read something about adding a git ignore file in the repository, not sure if that works.

(Ninad Phadke) #51

This seems to solve the problem!
(Although it would have been good to know why the files are getting created at all)
A more generic way of doing this (so that you don’t have to keep changing the folder name for every dataset you load in) -

UPDATE 1 - Thanks to @wilpat for pointing this out.

%cd '{PATH}'
!find '.' -name '*.ipynb_checkpoints' -exec rm -r {} +

This will recursively search all sub-folders in the dataset for the checkpoint files and delete them.

(William Okafor) #52

The read_dirs function has been updated with your code with a little extra, but i still got the same issue.

I had to add a check for ‘.ipynb_checkpoints’ in the loop creating fnames.
Pasting the edited code:

def read_dirs(path, folder):
lbls, fnames, all_lbls = [], [], []
full_path = os.path.join(path, folder)
for lbl in sorted(os.listdir(full_path)):
    if lbl not in ('.ipynb_checkpoints','.DS_Store'):
        for fname in os.listdir(os.path.join(full_path, lbl)):
            if fname not in ('.ipynb_checkpoints','.DS_Store'):
                fnames.append(os.path.join(folder, lbl, fname))
return fnames, lbls, all_lbls

(William Okafor) #53

I keep getting the issue of
find: ‘{PATH}’: No such file or directory

(Ninad Phadke) #54

A dumb question :raised_hands: but are you running this snippet after loading in the path variable?
In lesson1.ipynb this is on input 6.
PATH = "data/dogscats/"

(William Okafor) #56

Yes i am.

(Ninad Phadke) #57

Got it now. My bad. Two mistakes here.
!cd doesn’t actually change the path. Some weird thing with ipython and bash.
Should have used %cd

Second, in the second line, if I had cd’ed into the directory there is no need for the {PATH} variable. Should have replaced that with .

Leaves me wondering why it worked for me in the first place. Updating my answer.
Thanks for pointing this out!