Dataset duplicated/doubled for assignment C2W1, C2W2, C2W4

It seems that the dataset for assignments C2W1, C2W2, & C2W4 (maybe even C2W3 too but I finished that one way before) is corrupted somehow?

For example for C2W1, there is twice the amount of the expected dataset.
I then checked if there is anything weird in the directory using listdir and found

It seems for each image file there is a duplicate of it so for example
for 123.jpg there is 123_2024_10_28_20_54_52.jpg.

I didn’t do anything in the notebook, just followed the instructions.

Based on the timestamp of the duplication, it seems this issue is recent (October 28th, 2024 20:54:52 although I don’t know what timezone that is, my current time right now is October 29th, 2024 04:47:00 and I only started working on the assignment a few minutes ago)

Should I try deleting these duplicated files using os? Is there a way to maybe reset the whole lab including the files in it? (I tried rebooting but it’s still the same)

Coursera is currently having a lot of technical problems with delivering the lab content across multiple courses.

Maybe this is also part of the same problem.

Perhaps you could stand by and wait to see if the problem is resolved by itself soon.

Okay, for now a workaround is just to delete those duplicated files using

duplicate_suffix = '_2024_10_28_20_54_53.jpg'

for filename in os.listdir(data_dir_dogs):
    if filename.endswith(duplicate_suffix):
        file_path = os.path.join(data_dir_dogs, filename)
        os.remove(file_path)

print("Duplicate deletion for dogs complete.")

for filename in os.listdir(data_dir_cats):
    if filename.endswith(duplicate_suffix):
        file_path = os.path.join(data_dir_cats, filename)
        os.remove(file_path)

print("Duplicate deletion for cats complete.")

I was able to complete the assignment so it works.

1 Like

didn’t work.

Hi Adrian. Thank you for sharing this. I don’t see the same issue in my workspace but will observe if there are more learners affected by this. My hunch is this is an earlier attempt to fix a previous issue, but they revised it so it didn’t reach everyone (including me). We’ll look into it. Thanks again.

Hi Ahmad. You might have a different suffix that’s why it didn’t work. Take a look at this line from Adrian’s code:

duplicate_suffix = '_2024_10_28_20_54_53.jpg'

then modify it according to what you see in your workspace. Hope this helps.

Thanks for the reply, my problem is Already solved, what I do just, Rename the image folder and Update the lab to the latest, thus I got Freshly unduplicated image. Thanks Btw.

1 Like