Strange Bug and Broken notebook in C2_W4

In week4 grading assignment. There’s this very strange bug. If I open the train/A folder and browse a few images (open them in tabs by clicknig on them) then the count in dataset increases. The count exactly increases by 1 for every image that I’ve opened by double clicking. This is happening for both Validation and Train folder.

I also double checked counts with this function:


def count_files(directory):
    file_count = 0
    for root, dirs, files in os.walk(directory):
        file_count += len(files)
        for file in files: 
            if "note" in file: 
                print(file)
    return file_count


count_files(TRAIN_DIR)

Perhaps when you open a file, it’s creating a hidden temp file in case you want to save any changes.

Ya it’s strange. Not sure why is that happening.