Programming Assignment - Exercise 1 and 2

Hi, Can anybody tell me what I am doing wrong in the “split_data” function as my code generates 0 images in test and training directories? Further, can anybody tell me if I’m doing anything wrong in the “create_train_val_dirs” function? Thank You

Please remove code from your post. It’s okay to share stacktrace and screenshot of grader feedback.

Here are your mistakes:

  1. In split_data, you are already given directory locations via function parameters. So, don’t hardcode values.
  2. In create_train_val_dirs, see the typo in /validaion/

I don’t understand your point about “split_data”. Can you please elaborate?

1 Like

Sure. The function signature includes SOURCE_DIR, TRAINING_DIR, VALIDATION_DIR and SPLIT_SIZE. There’s no need to redefine these inside the function.

Then what do I need to do inside the function?

The instructions in the markdown are detailed. Please be specific about which part is confusing.

you need to first create directory path using os.path.join function and then create them using os.makedirs. This is described in the function under ‘# HINT:’