Hi, I'm trying to run inference.py on windows 10, but met an error with build.ninja:
Traceback (most recent call last):
File "C:\Users\v-sunzhe\Anaconda3\envs\sam_env\lib\site-packages\torch\utils\cpp_extension.py", line 1515, in _run_ninja_build
env=env)
File "C:\Users\v-sunzhe\Anaconda3\envs\sam_env\lib\subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "scripts/inference.py", line 19, in
from models.psp import pSp
File ".\models\psp.py", line 12, in
from models.encoders import psp_encoders
File ".\models\encoders\psp_encoders.py", line 8, in
from models.stylegan2.model import EqualLinear
File ".\models\stylegan2\model.py", line 7, in
from models.stylegan2.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
File ".\models\stylegan2\op_init_.py", line 1, in
from .fused_act import FusedLeakyReLU, fused_leaky_relu
File ".\models\stylegan2\op\fused_act.py", line 13, in
os.path.join(module_path, 'fused_bias_act_kernel.cu'),
File "C:\Users\v-sunzhe\Anaconda3\envs\sam_env\lib\site-packages\torch\utils\cpp_extension.py", line 974, in load
keep_intermediates=keep_intermediates)
File "C:\Users\v-sunzhe\Anaconda3\envs\sam_env\lib\site-packages\torch\utils\cpp_extension.py", line 1179, in _jit_compile
with_cuda=with_cuda)
File "C:\Users\v-sunzhe\Anaconda3\envs\sam_env\lib\site-packages\torch\utils\cpp_extension.py", line 1279, in _write_ninja_file_and_build_library
error_prefix="Error building extension '{}'".format(name))
File "C:\Users\v-sunzhe\Anaconda3\envs\sam_env\lib\site-packages\torch\utils\cpp_extension.py", line 1529, in _run_ninja_build
raise RuntimeError(message)
RuntimeError: Error building extension 'fused': ninja: error: build.ninja:3: lexing error
I used the following command to start inference.py:
python scripts/inference.py
--exp_dir=./experiment
--checkpoint_path=./experiment/checkpoints/sam_ffhq_aging.pt
--data_path=./test_data
--test_batch_size=1
--test_workers=1
--target_age=40,50,60,70,80
I followed steps in README to set up the conda environment. However, because of win10, I couldn't use "conda env create" to create right from the yaml file. As an alternative, I manually use conda to install those packages one by one. Here's my conda list:
Name Version Build Channel
_libgcc_mutex 0.1 main
absl-py 0.13.0 py36haa95532_0
aiohttp 3.7.4 py36h2bbff1b_1
async-timeout 3.0.1 py36haa95532_0
attrs 21.2.0 pyhd3eb1b0_0
blas 1.0 mkl
blinker 1.4 py36haa95532_0
brotlipy 0.7.0 py36h2bbff1b_1003
ca-certificates 2020.10.14 0 anaconda
cachetools 4.2.2 pyhd3eb1b0_0
certifi 2020.6.20 py36_0 anaconda
cffi 1.14.6 py36h2bbff1b_0
chardet 3.0.4 py36haa95532_1003
click 8.0.1 pyhd3eb1b0_0
coverage 5.5 py36h2bbff1b_2
cryptography 3.4.7 py36h71e12ea_0
cudatoolkit 10.1.243 h74a9793_0 anaconda
cudnn 7.6.5 cuda10.1_0 anaconda
cycler 0.10.0 py36haa95532_0
cython 0.29.24 py36hd77b12b_0
freetype 2.10.4 hd328e21_0
google-auth 1.33.0 pyhd3eb1b0_0
google-auth-oauthlib 0.4.4 pyhd3eb1b0_0
grpcio 1.36.1 py36hc60d5dd_1
icc_rt 2019.0.0 h0cc432a_1
icu 64.2 he025d50_1 conda-forge
idna 2.10 pyhd3eb1b0_0
idna_ssl 1.1.0 py36haa95532_0
importlib-metadata 3.10.0 py36haa95532_0
intel-openmp 2021.3.0 haa95532_3372
jpeg 9d h8ffe710_0 conda-forge
kiwisolver 1.3.1 py36hd77b12b_0
libblas 3.8.0 14_mkl conda-forge
libcblas 3.8.0 14_mkl conda-forge
libclang 9.0.1 default_hf44288c_0
libffi 3.2.1 ha925a31_1007 conda-forge
liblapack 3.8.0 14_mkl conda-forge
liblapacke 3.8.0 14_mkl conda-forge
libopencv 4.2.0 py36_7 conda-forge
libpng 1.6.37 h2a8f88b_0
libprotobuf 3.17.2 h23ce68f_1
libtiff 4.2.0 hd0e1b90_0
libwebp 1.2.0 h2bbff1b_0
libwebp-base 1.2.0 h2bbff1b_0
lz4-c 1.9.3 h2bbff1b_0
m2w64-gcc-libgfortran 5.3.0 6 conda-forge
m2w64-gcc-libs 5.3.0 7 conda-forge
m2w64-gcc-libs-core 5.3.0 7 conda-forge
m2w64-gmp 6.1.0 2 conda-forge
m2w64-libwinpthread-git 5.0.0.4634.697f757 2 conda-forge
markdown 3.3.4 py36haa95532_0
matplotlib 3.2.1 0 conda-forge
matplotlib-base 3.2.1 py36h64f37c6_0
mkl 2019.4 245
mkl-service 2.3.0 py36h196d8e1_0
mkl_fft 1.3.0 py36h46781fe_0
mkl_random 1.1.0 py36h675688f_0
msys2-conda-epoch 20160418 1 conda-forge
multidict 5.1.0 py36h2bbff1b_2
ninja 1.10.0 h1ad3211_0 conda-forge
numpy 1.18.5 py36h6530119_0 anaconda
numpy-base 1.18.5 py36hc3f5095_0
oauthlib 3.1.1 pyhd3eb1b0_0
olefile 0.46 py36_0
opencv 4.2.0 py36_7 conda-forge
openssl 1.1.1k h2bbff1b_0
pillow 7.1.2 py36hcc1f983_0 anaconda
pip 20.0.2 py36_3
protobuf 3.17.2 py36hd77b12b_0
py-opencv 4.2.0 py36h95af2a2_7 conda-forge
pyasn1 0.4.8 py_0
pyasn1-modules 0.2.8 py_0
pycparser 2.20 py_2
pyjwt 2.1.0 py36haa95532_0
pyopenssl 20.0.1 pyhd3eb1b0_1
pyparsing 2.4.7 pyhd3eb1b0_0
pyqt 5.12.3 py36h6538335_1 conda-forge
pyqt5-sip 4.19.18 pypi_0 pypi
pyqtwebengine 5.12.1 pypi_0 pypi
pysocks 1.7.1 py36haa95532_0
python 3.6.7 he025d50_1008_cpython conda-forge
python-dateutil 2.8.2 pyhd3eb1b0_0
python_abi 3.6 1_cp36m conda-forge
pytorch 1.6.0 py3.6_cuda101_cudnn7_0 pytorch
qt 5.12.5 h7ef1ec2_0 conda-forge
requests 2.25.1 pyhd3eb1b0_0
requests-oauthlib 1.3.0 py_0
rsa 4.7.2 pyhd3eb1b0_1
scipy 1.4.1 py36h9439919_0 anaconda
setuptools 46.4.0 py36_0
six 1.16.0 pyhd3eb1b0_0
sqlite 3.31.1 h2a8f88b_1
tensorboard 2.2.1 pyh532a8cf_0
tensorboard-plugin-wit 1.6.0 py_0
tk 8.6.8 hfa6e2cd_1000 conda-forge
torchvision 0.7.0 py36_cu101 pytorch
tornado 6.1 py36h2bbff1b_0
tqdm 4.46.0 pyh9f0ad1d_0 conda-forge
typing-extensions 3.10.0.0 hd3eb1b0_0
typing_extensions 3.10.0.0 pyh06a4308_0
urllib3 1.26.6 pyhd3eb1b0_1
vc 14.2 h21ff451_1
vs2015_runtime 14.27.29016 h5e58377_2
werkzeug 1.0.1 pyhd3eb1b0_0
wheel 0.34.2 py36_0 conda-forge
win_inet_pton 1.1.0 py36haa95532_0
wincertstore 0.2 py36h7fe50ca_0
xz 5.2.5 h62dcd97_1 conda-forge
yarl 1.6.3 py36h2bbff1b_0
zipp 3.5.0 pyhd3eb1b0_0
zlib 1.2.11 h62dcd97_1010 conda-forge
zstd 1.4.9 h19a0ad4_0
P.S.: I have intalled pytroch 1.6, cudatoolkit 10.1, cudnn 7.6 with conda,and have one GPU on this device.