eladrich / pixel2style2pixel

Official Implementation for "Encoding in Style: a StyleGAN Encoder for Image-to-Image Translation" (CVPR 2021) presenting the pixel2style2pixel (pSp) framework
https://eladrich.github.io/pixel2style2pixel/
MIT License
3.19k stars 570 forks source link

Permission Denied #26

Closed berylsheep-up closed 3 years ago

berylsheep-up commented 3 years ago

Hello, when I run your project on the sever, it found that there is a permission error as follow: (py3.6) beryl@delta:~/github/pixel2style2pixel$ python scripts/train.py --dataset_type=ffhq_encode --exp_dir=./experiment --workers=8 --batch_size=8 --test_batch_size=8 --test_workers=8 --val_interval=2500 --save_interval=5000 --encoder_type=GradualStyleEncoder --start_from_latent_avg --lpips_lambda=0.8 --l2_lambda=1 --id_lambda=0.1 Traceback (most recent call last): File "scripts/train.py", line 14, in <module> from training.coach import Coach File "./training/coach.py", line 19, in <module> from models.psp import pSp File "./models/psp.py", line 9, in <module> from models.encoders import psp_encoders File "./models/encoders/psp_encoders.py", line 8, in <module> from models.stylegan2.model import EqualLinear File "./models/stylegan2/model.py", line 7, in <module> from models.stylegan2.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d File "./models/stylegan2/op/__init__.py", line 1, in <module> from .fused_act import FusedLeakyReLU, fused_leaky_relu File "./models/stylegan2/op/fused_act.py", line 13, in <module> os.path.join(module_path, 'fused_bias_act_kernel.cu'), File "/mnt/lab/beryl/anaconda3/envs/py3.6/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 898, in load is_python_module) File "/mnt/lab/beryl/anaconda3/envs/py3.6/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1075, in _jit_compile if baton.try_acquire(): File "/mnt/lab/beryl/anaconda3/envs/py3.6/lib/python3.6/site-packages/torch/utils/file_baton.py", line 36, in try_acquire self.fd = os.open(self.lock_file_path, os.O_CREAT | os.O_EXCL) PermissionError: [Errno 13] Permission denied: '/tmp/torch_extensions/fused/lock'

But when I use the sudo demand, another error accurs: (py3.6) beryl@delta:~/github/pixel2style2pixel$ sudo python scripts/train.py --dataset_type=ffhq_encode --exp_dir=./experiment --workers=8 --batch_size=8 --test_batch_size=8 --test_workers=8 --val_interval=2500 --save_interval=5000 --encoder_type=GradualStyleEncoder --start_from_latent_avg --lpips_lambda=0.8 --l2_lambda=1 --id_lambda=0.1 Traceback (most recent call last): File "scripts/train.py", line 14, in <module> from training.coach import Coach File "./training/coach.py", line 3, in <module> import matplotlib ImportError: No module named matplotlib This error seems that the file is not run on the proper environment, because I am using the anaconda environment while the environment has matplotlib package. Can you provide me some help? Thanks!

yuval-alaluf commented 3 years ago

I believe what is happening is that when running with sudo you are no longer using the correct PATH. You can check this using

sudo which python

and check that you are still using the desired Anaconda interpreter.

yuval-alaluf commented 3 years ago

I am closing this for now. If you are still encountering issues feel free to reopen. Or if you found the solution, feel free to update to help others 😄