C2W2 Assignment - SPLIT-Function

Hi everybody,
I’m stuck on this assignment and would really appreciate your help.
I wrote all required code snippet, all tests passed, the output is as was expected.
When I send it in for evaluation, the following message appears for the split_data function:

Failed test case: failed to omit zero-length image. Tested with 6 images (one of zero length).
Expected:
5 files copied,
but got:
4. //why would my code copy only four?

Failed test case: incorrect number of training images when using split of 1.0 and a total of 123 images.
Expected:
123,
but got:
110. // why would 13 files disappear?

Failed test case: incorrect number of training images when using split of 0.5 and a total of 123 images.
Expected:
a value close to 61 with absolute tolerance of +/- 1,
but got:
110.

Failed test case: incorrect number of validation images when using split of 0.5 and a total of 123 images.
Expected:
a value close to 61 with absolute tolerance of +/- 1,
but got:
13.

Failed test case: incorrect number of (training, validation) images when using a split of 0.5 and 12 images (6 are zero-sized).
Expected:
(3, 3),
but got:
(5, 1).

What did my program do? Why on earth does it leave out more files, when it works fine with the cats-and-dogs-set?
I hope somebody will see the numbers and get a beautiful-mind-moment, because I cannot post my code here - and numbers do not speak to me…

I appreciate the help!

Are you hardcoding paths or using global variables instead of function parameters?

If that’s not the case, please click my name and message your notebook as an attachment.

Here are some hints:

  1. In function split_data, you are using split_size which is a global variable. Python is case sensitive. Please look at the function parameters to fix this issue.
  2. In function train_val_generators, you are hardcoding paths rather than using function parameters for specifying the locations for ImageDataGenerator.

Thank you so much!

I really see that I have to dig deeper into Python Basics (again)…

Appreciate the quick help!