C2W1 Assignment Directory not creating

Hi there!

I am trying to split the cats and dogs data into training and validation, but the directory is not creating. I have added screenshots of the relevant code for context. If anyone could help point out why this is not working it would be a big help!

Hi @TimV1

Try updating your notebook by pushing the end date or revert your notebook to the latest version. See if that helps!

Thank you for the response @Alireza_Saei!

I assume you are referring to my course end date? As far as I can see the end date is in the future and does not need to be pushed.

I am afraid I’m not entirely sure what you mean by reverting my notebook to the latest version, I have tried opening a new notebook from the assignment page; the code runs but the directory is not created.

create_train_val_dirs expects you to create the actual directory structure as shown in the Expected Output section. Unfortunately, os.path.join doesn’t create the directory. See os.makedirs and os.mkdir on how to make the actual directories along with os.path.join.

Sharing code on a public topic is discouraged according to deeplearning.ai policy. Please remove the screenshots.

Hey again @TimV1 ,

I agree with @balaji.ambresh. I didn’t fully inspect your code initially, assuming the issue was with the notebook itself. Please make sure you’re using the correct functions to create the necessary directories.

By the way, if you want to reset your notebook and start fresh, you can revert to the latest version from the File → Checkpoints section.

Ahh thank you, that solved it! Apologies about the code, I am a bit new to the forum. How would be best to share problems like this in the future?

Thank you for the help! Problem solved. Thanks for the refresh tip as well

You’re welcome, good luck :raised_hands:

You’re welcome. Please do one of the following:

  1. Share stacktrace of the issue if one is available.
  2. Ping a mentor for the specialization via a direct message which can include the notebook / as much code as you want.
  3. Wait for a mentor to respond to you and chat with all details.

Good luck.

1 Like