FusionBrainLab / HairFastGAN

Official Implementation for "HairFastGAN: Realistic and Robust Hair Transfer with a Fast Encoder-Based Approach"
https://airi-institute.github.io/HairFastGAN/
MIT License
413 stars 60 forks source link

ImportError: DLL load failed while importing fused: The specified module could not be found. #14

Open bhavesh-hirpara opened 2 months ago

bhavesh-hirpara commented 2 months ago
(hairenv) PS E:\Python Project\HairFastGAN> pip list     
Package              Version
-------------------- ------------
addict               2.4.0
appdirs              1.4.4
build                1.2.1
CacheControl         0.14.0
certifi              2024.2.2
charset-normalizer   3.3.2
cleo                 2.1.0
click                8.1.7
clip                 1.0
colorama             0.4.6
contourpy            1.2.0
crashtest            0.4.1
cycler               0.12.1
dill                 0.3.6
distlib              0.3.8
dlib                 19.24.1
docker-pycreds       0.4.0
dulwich              0.21.7
face_alignment       1.3.4
fastjsonschema       2.19.1
filelock             3.13.1
fonttools            4.50.0
fsspec               2024.2.0
ftfy                 6.2.0
gdown                3.12.2
gitdb                4.0.11
GitPython            3.1.42
idna                 3.6
imageio              2.34.0
importlib_metadata   7.1.0
installer            0.7.0
intel-openmp         2021.4.0
jaraco.classes       3.4.0
Jinja2               3.1.4
joblib               1.2.0
keyring              24.3.1
kiwisolver           1.4.5
lazy_loader          0.3
llvmlite             0.42.0
MarkupSafe           2.1.5
matplotlib           3.7.1
mkl                  2021.4.0
more-itertools       10.3.0
mpmath               1.3.0
msgpack              1.0.8
networkx             3.2.1
ninja                1.11.1.1
numba                0.59.1
numpy                1.23.5
opencv-python        4.7.0.72
packaging            24.0
pandas               2.0.1
pathtools            0.1.2
pexpect              4.9.0
Pillow               10.0.0
pip                  24.1
pkginfo              1.11.1
platformdirs         4.2.2
poetry               1.8.3
poetry-core          1.9.0
poetry-plugin-export 1.8.0
protobuf             4.25.3
psutil               5.9.8
ptyprocess           0.7.0
pyparsing            3.1.2
pyproject_hooks      1.1.0
PySocks              1.7.1
python-dateutil      2.9.0.post0
pytz                 2024.1
pywin32-ctypes       0.2.2
PyYAML               6.0.1
rapidfuzz            3.9.3
regex                2023.12.25
requests             2.31.0
requests-toolbelt    1.0.0
scikit-image         0.22.0
scikit-learn         1.2.2
sentry-sdk           1.43.0
setproctitle         1.3.3
setuptools           69.2.0
shellingham          1.5.4
six                  1.16.0
smmap                5.0.1
sympy                1.12.1
tbb                  2021.11.0
threadpoolctl        3.4.0
tifffile             2024.2.12
tomli                2.0.1
tomlkit              0.12.5
torch                1.13.1+cu117
torchmetrics         0.11.4
torchvision          0.14.1+cu117
tqdm                 4.66.1
trove-classifiers    2024.5.22
typing_extensions    4.10.0
tzdata               2024.1
urllib3              2.2.1
virtualenv           20.26.2
wandb                0.15.10
wcwidth              0.2.13
zipp                 3.19.2
(hairenv) PS E:\Python Project\HairFastGAN> python main.py --face_path=6.png --shape_path=7.png --color_path=8.png --input_dir=input --result_path=output/result.png
fused
C:\Users\PC\AppData\Local\torch_extensions\torch_extensions\Cache\py310_cu117\fused\fused.pyd
ModuleSpec(name='fused', loader=<_frozen_importlib_external.ExtensionFileLoader object at 0x000001D6FC817100>, origin='C:\\Users\\PC\\AppData\\Local\\torch_extensions\\torch_extensions\\Cache\\py310_cu117\\fused\\fused.pyd') 
Traceback (most recent call last):
  File "E:\Python Project\HairFastGAN\main.py", line 9, in <module>
    from hair_swap import HairFast, get_parser
  File "E:\Python Project\HairFastGAN\hair_swap.py", line 13, in <module>
    from models.Alignment import Alignment
  File "E:\Python Project\HairFastGAN\models\Alignment.py", line 8, in <module>
    from models.Encoders import RotateModel
  File "E:\Python Project\HairFastGAN\models\Encoders.py", line 9, in <module>
    from models.Net import FeatureEncoderMult, IBasicBlock, conv1x1
  File "E:\Python Project\HairFastGAN\models\Net.py", line 9, in <module>
    from models.stylegan2.model import Generator
  File "E:\Python Project\HairFastGAN\models\stylegan2\model.py", line 11, in <module>
    from models.stylegan2.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
  File "E:\Python Project\HairFastGAN\models\stylegan2\op\__init__.py", line 1, in <module>
    from .fused_act import FusedLeakyReLU, fused_leaky_relu
  File "E:\Python Project\HairFastGAN\models\stylegan2\op\fused_act.py", line 10, in <module>
    fused = load(
  File "E:\Python Project\HairFastGAN\hairenv\lib\site-packages\torch\utils\cpp_extension.py", line 1284, in load
    return _jit_compile(
  File "E:\Python Project\HairFastGAN\hairenv\lib\site-packages\torch\utils\cpp_extension.py", line 1534, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
  File "E:\Python Project\HairFastGAN\hairenv\lib\site-packages\torch\utils\cpp_extension.py", line 1939, in _import_module_from_library
    module = importlib.util.module_from_spec(spec)
ImportError: DLL load failed while importing fused: The specified module could not be found.

I really need help in this. I have already installed visual studio 2022 on Windows. Still getting DLL loading error

image