VinAIResearch / HyperInverter

HyperInverter: Improving StyleGAN Inversion via Hypernetwork (CVPR 2022)
https://di-mi-ta.github.io/HyperInverter/
BSD 3-Clause "New" or "Revised" License
116 stars 13 forks source link

Problem testing inference #2

Closed Mayorc1978 closed 2 years ago

Mayorc1978 commented 2 years ago

Trying to run inference on Windows: Installed all requirements without any error, but I do get one when try to run inference:

(HyperInverter) H:\AI\HyperInverter>python scripts/inference.py --exp_dir=./results --checkpoint_path=./pretrained_models/hyper_inverter_e4e_ffhq_encode_large.pt --data_path=./data --batch_size= 4 --workers=4
C:\Users\GIN\.conda\envs\HyperInverter\lib\site-packages\torch\utils\cpp_extension.py:287: UserWarning: Error checking compiler version for cl: [WinError 2] Impossibile trovare il file specificato
  warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
INFORMAZIONI: impossibile trovare file corrispondenti ai
criteri di ricerca indicati.
Traceback (most recent call last):
  File "scripts/inference.py", line 14, in <module>
    from models.hyper_inverter import HyperInverter  # noqa: E402
  File ".\models\hyper_inverter.py", line 10, in <module>
    from models.encoders import fpn_encoders
  File ".\models\encoders\fpn_encoders.py", line 5, in <module>
    from models.stylegan2.model import EqualLinear
  File ".\models\stylegan2\model.py", line 5, 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 14, in <module>
    os.path.join(module_path, "fused_bias_act_kernel.cu"),
  File "C:\Users\GIN\.conda\envs\HyperInverter\lib\site-packages\torch\utils\cpp_extension.py", line 997, in load
    keep_intermediates=keep_intermediates)
  File "C:\Users\GIN\.conda\envs\HyperInverter\lib\site-packages\torch\utils\cpp_extension.py", line 1202, in _jit_compile
    with_cuda=with_cuda)
  File "C:\Users\GIN\.conda\envs\HyperInverter\lib\site-packages\torch\utils\cpp_extension.py", line 1293, in _write_ninja_file_and_build_library
    with_cuda=with_cuda)
  File "C:\Users\GIN\.conda\envs\HyperInverter\lib\site-packages\torch\utils\cpp_extension.py", line 1689, in _write_ninja_file_to_build_library
    with_cuda=with_cuda)
  File "C:\Users\GIN\.conda\envs\HyperInverter\lib\site-packages\torch\utils\cpp_extension.py", line 1791, in _write_ninja_file
    'cl']).decode().split('\r\n')
  File "C:\Users\GIN\.conda\envs\HyperInverter\lib\subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "C:\Users\GIN\.conda\envs\HyperInverter\lib\subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1.
Mayorc1978 commented 2 years ago

Fixed it finding Cl.exe and adding the BIN directory to PATH env. variable.