Reputation: 61
I am using a virtual machine on Azure for GPU compute. In a conda environment, I am trying to replicate a paper and train the model, but one of the preprocessing files (all files are in python) uses this code:
mkdir(name, mode)
Which give me this error:
Traceback (most recent call last):
File "/home/ryuparish/multidoc2dial/scripts/model_converter.py", line 45, in <module>
main()
File "/home/ryuparish/multidoc2dial/scripts/model_converter.py", line 39, in main
model.save_pretrained(args.out_path)
File "/anaconda/envs/multidoc2dial/lib/python3.9/site-packages/transformers/modeling_utils.py", line 1029, in save_pretrained
os.makedirs(save_directory, exist_ok=True)
File "/anaconda/envs/multidoc2dial/lib/python3.9/os.py", line 225, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/rag-dpr-studentaid-structure'
I assumed this was because conda does not have permissions to make that directory. I then tried using sudo sudo (same command)
but this will not recognize any of my packages in my conda environment.
How do I allow conda to create directories?
Upvotes: 0
Views: 678
Reputation: 61
The problem was with an undefined bash environment variable which was supposed to be appended to the front of the directory to be made. Since the variable was completely blank (undefined), the root directory became the target directory, and that is where the permission errors arose.
I just set the environment variable, sourced .bashrc, and everything worked afterwards.
Upvotes: 0