# My expected ouput for split\_data is different

**URL:** <https://community.deeplearning.ai/t/my-expected-ouput-for-split-data-is-different/162656>\
**Category:** Convolutional Neural Networks in TensorFlow\
**Tags:** week-module-2\
**Created:** [July 16, 2022, 5:35am UTC](https://community.deeplearning.ai/t/my-expected-ouput-for-split-data-is-different/162656 "2022-07-16T05:35:49Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rifah\_Maulidya](https://avatars.discourse-cdn.com/v4/letter/r/c4cdca/32.png) [@Rifah\_Maulidya](https://community.deeplearning.ai/u/Rifah_Maulidya)\
**Post date:** [July 16, 2022, 5:35am UTC](https://community.deeplearning.ai/t/my-expected-ouput-for-split-data-is-different/162656/1 "2022-07-16T05:35:49Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [July 16, 2022, 8:04am UTC](https://community.deeplearning.ai/t/my-expected-ouput-for-split-data-is-different/162656/2 "2022-07-16T08:04:53Z")

</div>

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

```auto
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:

```auto
# 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.

---

<div class="post-metadata">

**Author:** ![Rifah\_Maulidya](https://avatars.discourse-cdn.com/v4/letter/r/c4cdca/32.png) [@Rifah\_Maulidya](https://community.deeplearning.ai/u/Rifah_Maulidya)\
**Post date:** [July 17, 2022, 1:55am UTC](https://community.deeplearning.ai/t/my-expected-ouput-for-split-data-is-different/162656/3 "2022-07-17T01:55:06Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [July 17, 2022, 6:17am UTC](https://community.deeplearning.ai/t/my-expected-ouput-for-split-data-is-different/162656/4 "2022-07-17T06:17:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [July 17, 2022, 12:08pm UTC](https://community.deeplearning.ai/t/my-expected-ouput-for-split-data-is-different/162656/5 "2022-07-17T12:08:17Z")

</div>

Notebook metadata is corrupt. Please refresh your workspace and try again.  
See `Refresh your Lab Workspace` section [here](https://www.coursera.support/s/article/360044758731-Solving-common-issues-with-Coursera-Labs?language=en_US)  
If you’ve already done this, contact coursera [help](https://coursera.org/help)

See [this](https://community.deeplearning.ai/t/name-training-images-is-not-defined/161543/5) link to learn more about grader metadata.

---

<div class="post-metadata">

**Author:** ![Michio\_Suginoo](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@Michio\_Suginoo](https://community.deeplearning.ai/u/Michio_Suginoo)\
**Post date:** [July 19, 2022, 7:10pm UTC](https://community.deeplearning.ai/t/my-expected-ouput-for-split-data-is-different/162656/6 "2022-07-19T19:10:28Z")

</div>

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.

 ![Image Count](https://global.discourse-cdn.com/dlai/original/3X/0/6/06ad026f5e5931ed0c154b7ecfb9f20cbfdc7d52.png)

Which is correct?  
Thanks in advance  
Best regards

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [July 19, 2022, 7:22pm UTC](https://community.deeplearning.ai/t/my-expected-ouput-for-split-data-is-different/162656/7 "2022-07-19T19:22:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Michio\_Suginoo](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@Michio\_Suginoo](https://community.deeplearning.ai/u/Michio_Suginoo)\
**Post date:** [July 19, 2022, 7:26pm UTC](https://community.deeplearning.ai/t/my-expected-ouput-for-split-data-is-different/162656/8 "2022-07-19T19:26:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Soeren\_Brockmann](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Soeren\_Brockmann](https://community.deeplearning.ai/u/Soeren_Brockmann)\
**Post date:** [August 15, 2022, 11:25am UTC](https://community.deeplearning.ai/t/my-expected-ouput-for-split-data-is-different/162656/9 "2022-08-15T11:25:56Z")

</div>

I still get the same error.

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [August 15, 2022, 1:54pm UTC](https://community.deeplearning.ai/t/my-expected-ouput-for-split-data-is-different/162656/10 "2022-08-15T13:54:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Soeren\_Brockmann](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Soeren\_Brockmann](https://community.deeplearning.ai/u/Soeren_Brockmann)\
**Post date:** [August 15, 2022, 2:50pm UTC](https://community.deeplearning.ai/t/my-expected-ouput-for-split-data-is-different/162656/11 "2022-08-15T14:50:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [August 15, 2022, 3:30pm UTC](https://community.deeplearning.ai/t/my-expected-ouput-for-split-data-is-different/162656/12 "2022-08-15T15:30:02Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Soeren\_Brockmann](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Soeren\_Brockmann](https://community.deeplearning.ai/u/Soeren_Brockmann)\
**Post date:** [August 15, 2022, 4:56pm UTC](https://community.deeplearning.ai/t/my-expected-ouput-for-split-data-is-different/162656/13 "2022-08-15T16:56:14Z")

</div>

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

 ![Screenshot 2022-08-15 at 18.53.42](https://global.discourse-cdn.com/dlai/original/3X/f/6/f6dcd3e56b36eaf1fc405250da6d644a4257f636.png)

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [August 15, 2022, 5:28pm UTC](https://community.deeplearning.ai/t/my-expected-ouput-for-split-data-is-different/162656/14 "2022-08-15T17:28:29Z")

</div>

@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.
