Permission error while executing os.makedirs in lesson2-image_models.ipynb


PermissionError Traceback (most recent call last)
in
2
3 os.makedirs(‘data/planet/models’, exist_ok=True)
----> 4 os.makedirs(’/cache/planet/tmp’, exist_ok=True)
5
6 get_ipython().system(‘ln -s /datasets/kaggle/planet-understanding-the-amazon-from-space/train-jpg {PATH}’)

~/anaconda2/envs/fastai/lib/python3.7/os.py in makedirs(name, mode, exist_ok)
209 if head and tail and not path.exists(head):
210 try:
–> 211 makedirs(head, exist_ok=exist_ok)
212 except FileExistsError:
213 # Defeats race condition when another thread created the path

~/anaconda2/envs/fastai/lib/python3.7/os.py in makedirs(name, mode, exist_ok)
209 if head and tail and not path.exists(head):
210 try:
–> 211 makedirs(head, exist_ok=exist_ok)
212 except FileExistsError:
213 # Defeats race condition when another thread created the path

~/anaconda2/envs/fastai/lib/python3.7/os.py in makedirs(name, mode, exist_ok)
219 return
220 try:
–> 221 mkdir(name, mode)
222 except OSError:
223 # Cannot rely on checking for EEXIST, since the operating system

PermissionError: [Errno 13] Permission denied: ‘/cache’

Fixed it. It was thecode for Crestle users and I am not using Crestle. So, that was giving me an error.