Details of failed tests for create_train_test_dirs

Hello @Ran_Duan ,

You’re welcome!
Thanks for sending your file.I have reciprocated the same on my end and fixed the issue now.

In the first graded function, there has been an error as per the test case, though outputs are fine.

It’s mentioned in the hint :

# Don't hardcode the paths. Use os.path.join to append the new directories to the root_path parameter

You had written code for every directory/path individually.Though output comes the expected, but approach was different from what was required as per given in the hint to pass the test case.

You can do the graded function part in lesser lines.Writing logic for one, will do for the rest.

Your file gave the error which you mentioned.Then, in your file only, I had just changed this part and again got full marks in Graded Functions.

To pass the test case, following the instructions of the hint , you can do it like this way :

  1. Take inputs cats and dogs in a list.
  2. Now run a simple loop in the list
  3. Get subdirectories : cats,dogs under directories of training and testing with os.makedirs and append the new directories to the root_path parameter with os.path.join .

Hope this helps.

With regards,
Nilosree Sengupta

3 Likes