C2W1 Assignment | Failed test case has incorrect type

Hello @mhdlyy.k ,

I have checked your notebook.
Under every function, Your outputs have matched with the expected outputs.But target is not just matching outputs, but also passing test cases.

For passing test cases, you need to go thoroughly through the hints and informations provided before every graded functions.

So all functions, you need to rewrite.

1. Under GRADED FUNCTION: create_train_test_dirs

Refer to my reply to another learner here : Details of failed tests for create_train_test_dirs - #7 by nilosreesengupta

2. Under GRADED FUNCTION: split_data

It’s given in the paragraph above :

2.1. All images should be checked before the copy, so if they have a zero file length, they will be omitted from the copying process. If this is the case then your function should print out a message such as “filename is zero length, so ignoring.”. You should perform this check before the split so that only non-zero images are considered when doing the actual split.
But You are checking this at last.

The thing is if you remove the non-required part before, it will decrease the time for checking.
(Not only this particular assignment, whenever you are given data, remove the non-required part, it will reduce space and time.This will improve efficiency of your code.)

2.2 You need to keep in mind the division of data. 90% for training and 10% for validation.

You are checking value of i < total_file*SPLIT_SIZE.This won’t pass the test case.Check the hint.
You need to divide at first into 2 parts. 90% and 10%.
Then you have to run a loop check i belongs to which part.
Then copy file from source to destination

2.3. In the hint it is given:

##copyfile(source, destination) : copies a file from source to destination
So file should be copied using this instead of os.path.join.

Go step by step.Read the paragraph and the hints.

3. Under def train_val_generators(TRAINING_DIR, VALIDATION_DIR):

Under this part :
#Pass in the appropiate arguments to the flow_from_directory method for train_generator and validation_generator:

i.Batch sizes will be more. Try to figure out what it can be.
ii. You dont need to take input shape thrice for Conv2D.

Hope this helps.

With regards,
Nilosree Sengupta