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.2k stars 568 forks source link

get error when I run inference, the problem maybe about ninja ? #276

Closed li-car-fei closed 2 years ago

li-car-fei commented 2 years ago

RuntimeError: Error building extension 'fused': [1/2] /usr/bin/nvcc -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/bishe/anaconda3/envs/LJH_psp_env/lib/python3.6/site-packages/torch/include -isystem /home/bishe/anaconda3/envs/LJH_psp_env/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /home/bishe/anaconda3/envs/LJH_psp_env/lib/python3.6/site-packages/torch/include/TH -isystem /home/bishe/anaconda3/envs/LJH_psp_env/lib/python3.6/site-packages/torch/include/THC -isystem /home/bishe/anaconda3/envs/LJH_psp_env/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_61,code=sm_61 --compiler-options '-fPIC' -std=c++14 -c /home/bishe/LJH/pixel2style2pixel/models/stylegan2/op/fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o FAILED: fused_bias_act_kernel.cuda.o /usr/bin/nvcc -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/bishe/anaconda3/envs/LJH_psp_env/lib/python3.6/site-packages/torch/include -isystem /home/bishe/anaconda3/envs/LJH_psp_env/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /home/bishe/anaconda3/envs/LJH_psp_env/lib/python3.6/site-packages/torch/include/TH -isystem /home/bishe/anaconda3/envs/LJH_psp_env/lib/python3.6/site-packages/torch/include/THC -isystem /home/bishe/anaconda3/envs/LJH_psp_env/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_61,code=sm_61 --compiler-options '-fPIC' -std=c++14 -c /home/bishe/LJH/pixel2style2pixel/models/stylegan2/op/fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o nvcc fatal : Value 'c++14' is not defined for option 'std' ninja: build stopped: subcommand failed.

yuval-alaluf commented 2 years ago

Hi, this could be a mismatch between your pytorch version and cuda version. Can you provide more details regarding your pytorch version and environment?

li-car-fei commented 2 years ago

Hi, this could be a mismatch between your pytorch version and cuda version. Can you provide more details regarding your pytorch version and environment?

when I use the environment you provided, I get error like this: AssertionError: The NVIDIA driver on your system is too old (found version 10010). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver.

yuval-alaluf commented 2 years ago

It could be that you're CUDA version is incompatible with the pytorch version. Try understanding which Pytorch version is compatible with your environment.