yuval-alaluf / SAM

Official Implementation for "Only a Matter of Style: Age Transformation Using a Style-Based Regression Model" (SIGGRAPH 2021) https://arxiv.org/abs/2102.02754
https://yuval-alaluf.github.io/SAM/
MIT License
632 stars 151 forks source link

[Error] [Win] INFO: Could not find files for the given pattern(s). #48

Closed affanmehmood closed 2 years ago

affanmehmood commented 2 years ago

I ran scripts/inference.py with --exp_dir=output/ --checkpoint_path=saved_model/best_model.pt --data_path=input/ --test_batch_size=1 --test_workers=1 --target_age=0,10,20,30,40,50,60,70,80 arguments and got an error. Can you please help me resolve it?

dependency versions that I'm using on windows: cmake==3.22.4 dlib==19.24.0 ninja==1.10.2.3 numpy==1.21.6 scipy==1.7.3 torch==1.9.0+cu111 torchaudio==0.9.0 torchvision==0.10.0+cu111

C:\Work\SAM\venv\lib\site-packages\torch\utils\cpp_extension.py:305: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified warnings.warn(f'Error checking compiler version for {compiler}: {error}') INFO: Could not find files for the given pattern(s). Traceback (most recent call last): File "C:/Work/SAM/scripts/inference.py", line 20, in from models.psp import pSp File "C:\Work\SAM\models\psp.py", line 12, in from models.encoders import psp_encoders File "C:\Work\SAM\models\encoders\psp_encoders.py", line 8, in from models.stylegan2.model import EqualLinear File "C:\Work\SAM\models\stylegan2\model.py", line 7, in from models.stylegan2.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d File "C:\Work\SAM\models\stylegan2\op__init__.py", line 1, in from .fused_act import FusedLeakyReLU, fused_leaky_relu File "C:\Work\SAM\models\stylegan2\op\fused_act.py", line 13, in os.path.join(module_path, 'fused_bias_act_kernel.cu'), File "C:\Work\SAM\venv\lib\site-packages\torch\utils\cpp_extension.py", line 1092, in load keep_intermediates=keep_intermediates) File "C:\Work\SAM\venv\lib\site-packages\torch\utils\cpp_extension.py", line 1303, in _jit_compile is_standalone=is_standalone) File "C:\Work\SAM\venv\lib\site-packages\torch\utils\cpp_extension.py", line 1401, in _write_ninja_file_and_build_library is_standalone=is_standalone) File "C:\Work\SAM\venv\lib\site-packages\torch\utils\cpp_extension.py", line 1834, in _write_ninja_file_to_build_library with_cuda=with_cuda) File "C:\Work\SAM\venv\lib\site-packages\torch\utils\cpp_extension.py", line 1950, in _write_ninja_file 'cl']).decode().split('\r\n') File "C:\Users\affan\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 411, in check_output **kwargs).stdout File "C:\Users\affan\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 512, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1.

yuval-alaluf commented 2 years ago

As mentioned in the README, the codebase only supports running on Linux. If you wish to run on Windows, this thread could be helpful: https://github.com/eladrich/pixel2style2pixel/issues/29

affanmehmood commented 2 years ago

I tried out the possible solutions that were provided but couldn't find a solution for this error.

yuval-alaluf commented 2 years ago

You could try posting this issue in the rosinality SG2 repo which we use. You may be able to get a better response there. Unfortunately, I don't have Windows and am not familiar with running on Windows so I cannot be not much help here.

affanmehmood commented 2 years ago

Thanks, I'll definitely be doing that.