Kind Reminder for Submission Error of "root_dir" not defined

Hi everyone, if you encounter errors of “root_dir” is not defined or any subordinate directory, like “/tmp/cats-v-dogs/training/cats” is not define when you try to submit the Course 2 Week 1 cat-vs-dog assignment, but your code working perfectly fine on your local drive and all codes output are as expected, which is the same as templates.

PLEASE Follow this advice:
1, in def create_train_val_dirs function, following ###START CODE HERE, add just one line: root_path = ‘/tmp/cats-v-dogs’
2, following the root_path line above, begin your normal coding like os.makedirs(root_path)
3, problem solved, at least for me, and submission successful, passed.

Hope could help the one who experienced same issue like me.

Thanks for sharing.

This line is present in the assignment starter code:
root_dir = '/tmp/cats-v-dogs'

Please follow these steps to refresh your workspace rather than add configuration information manually.

root_path is a function parameter. So, it’s possible for the grader to use a different value other than the one you’ve provided. Please rely ONLY on the function parameter when applicable.

1 Like