My expected ouput for split_data is different

This is my output for the split data:
666.jpg is zero length, so ignoring.
11702.jpg is zero length, so ignoring.

Original cat’s directory has 12501 images
Original dog’s directory has 12501 images

There are 11250 images of cats for training
There are 11250 images of dogs for training
There are 1250 images of cats for validation
There are 1250 images of dogs for validation

while the expected output should be like this
666.jpg is zero length, so ignoring.
11702.jpg is zero length, so ignoring.

Original cat’s directory has 12500 images
Original dog’s directory has 12500 images

There are 11249 images of cats for training
There are 11249 images of dogs for training
There are 1250 images of cats for validation
There are 1250 images of dogs for validation

What’s wrong with it? could you help me, please?

Something is wrong with your notebook. This should be the output after extracting the zip file.

There are 12500 images of dogs.
There are 12500 images of cats.

Seems like you’re missing a line that removes all non jpg files:

# Deletes all non-image files (there are two .db files bundled into the dataset)
!find /tmp/PetImages/ -type f ! -name "*.jpg" -exec rm {} +

Please refresh your workspace and try again.

Hi, I have added the code on the line and it worked.
But when I submit my notebook, I got 50/100 which is in the graded function. This what the grader said:

Details of failed tests for create_train_val_dirs

Failed test case: create_train_val_dirs has incorrect type.
Expected:
typing.Callable,
but got:
<class ‘NoneType’>.

Details of failed tests for split_data

Failed test case: split_data has incorrect type.
Expected:
typing.Callable,
but got:
<class ‘NoneType’>.

Details of failed tests for train_val_generators

Failed test case: train_val_generators has incorrect type.
Expected:
typing.Callable,
but got:
<class ‘NoneType’>.

Details of failed tests for create_model

Failed test case: create_model has incorrect type.
Expected:
typing.Callable,
but got:
<class ‘NoneType’>.

Could you help me what’s wrong with it, please?

Please click my name and message your notebook as an attachment.

Notebook metadata is corrupt. Please refresh your workspace and try again.
See Refresh your Lab Workspace section here
If you’ve already done this, contact coursera help

See this link to learn more about grader metadata.

Hi,
Hi @balaji.ambresh

What I am confused about is that the instruction gives the expected output which suggests 12501 images for both dogs and cats.
You can confirm in the attached image herewith.

Which is correct?
Thanks in advance
Best regards

There should be 12500 images of each kind. Please ignore the expected output for now. The staff have now been asked to fix this. Thanks for bringing this up.

Thanks @balaji.ambresh for your immediate response!
Best regards
Michio

I still get the same error.

Please click my name and message your notebook as an attachment.

Done. I am facing the same issue with Week’s 2 Assignment.

@Soeren_Brockmann
Your split_data function is buggy. Here’s an example where your function will yield incorrect results.
Assume that there are 20 images out of which the first 10 images are size 0. The expected outcome of running your code is for the training and validation directories to have 5 images each.
Your implementation will copy all the 10 valid files into the validation directory and leave the training directory empty.

Thanks for checking it. But I already get a wrong output earlier (See Screenshot). This code was provided.

1 Like

@Soeren_Brockmann

Thank you for pointing this out.
The original zip file contains thumbs.db files.
The correct numbers are 12500 cats and dogs since the find command removes all files which don’t have jpg extension.
The issue is now reported for the staff to fix.

1 Like