C2W2 Assignment Cat vs Dog image Classification

In the course 2 week 2 (Cat vs Dog image classification) of this specialization I am getting an error but I am not able to identify it.
Here I am enclosing the screenshot of the error.


please send your codes screenshots for the starting two grade cell.

passing a test cell or getting expected output doesn’t always mean your codes are as per autograder.

click on my name and then message.

Hi @Shreyansh_Singh2603

Your codes are incorrect related to create val train dirs and split data. kindly refer the below comment link to make the correction.

You haven’t mentioned the first code directory path for the create train val dirs.
Notice while creating separate directory for dogs or cats in training or validation dataset you are suppose to use ‘training/dogs’ but you have used “training”,“dogs”

Next in split dataset, you are not suppose to use directory path os.path.join everywhere as the argument contains SOURCE_DIR (string): directory path containing the images (which if created correctly from the previous grade cell would take up the instruction correctly in split data grade cell.

You are also using incorrect function call shuffling, you are suppose to use random.sample to the file_list you created and the length of listed files (HINT GIVEN BEFORE THE GRADE CELL: * random.sample(list, len(list)) shuffles a list)

for your destination files while copying you needed to use directory path recalled in the argument for training and validation with the filename but you have created a directory path for this too which is incorrect.

Refer the pinged comment to go stepwise for both cell (note: your codes for create val train dirs requires only mild correction with an addition of the first directory code root path)

Let me know if your confusion stills persist.

Regards
DP