zyainfal / One-Shot-Face-Swapping-on-Megapixels

One Shot Face Swapping on Megapixels.
Other
314 stars 40 forks source link

Why is the "fused" module missing? #32

Closed an-zi-li closed 2 years ago

an-zi-li commented 2 years ago

I have installed torch==1.5.1 CUDA ==10.1 as you requested, but the following problems still occur

D:\anaconda\envs\torch151\python.exe D:/pycharm_workspace/Files/stylegan2/inference/inference.py Traceback (most recent call last): File "D:/pycharm_workspace/Files/stylegan2/inference/inference.py", line 4, in from megafs import resnet50, HieRFE, Generator, FaceTransferModule File "D:\pycharm_workspace\Files\stylegan2\inference\megafs.py", line 11, in from op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d File "D:\pycharm_workspace\Files\stylegan2\op__init__.py", line 1, in from .fused_act import FusedLeakyReLU, fused_leaky_relu File "D:\pycharm_workspace\Files\stylegan2\op\fused_act.py", line 15, in os.path.join(module_path, "fused_bias_act_kernel.cu"), File "D:\anaconda\envs\torch151\lib\site-packages\torch\utils\cpp_extension.py", line 921, in load is_python_module) File "D:\anaconda\envs\torch151\lib\site-packages\torch\utils\cpp_extension.py", line 1120, in _jit_compile return _import_module_from_library(name, build_directory, is_python_module) File "D:\anaconda\envs\torch151\lib\site-packages\torch\utils\cpp_extension.py", line 1441, in _import_module_from_library file, path, description = imp.find_module(module_name, [path]) File "D:\anaconda\envs\torch151\lib\imp.py", line 297, in find_module raise ImportError(_ERR_MSG.format(name), name=name) ImportError: No module named 'fused'

zyainfal commented 2 years ago

It seems rosinality has changed the file fused_act.py. You can find the version I used in my forked repositories here.

an-zi-li commented 2 years ago

似乎 rosinality 改变了文件fused_act.py您可以在此处 找到我在分叉存储库中使用的版本。

Hi, I have looked at some of the libraries, but I find that my problem is still not found in the solution

zyainfal commented 2 years ago

I noticed that File "D:\pycharm_workspace\Files\stylegan2\op\fused_act.py", line 15, in os.path.join(module_path, "fused_bias_act_kernel.cu"), as you used Windows OS, may this module_path is not same as it in Linux?

And every step the script searches files may suffer from this issue, like the [path] in File "D:\anaconda\envs\torch151\lib\site-packages\torch\utils\cpp_extension.py", line 1441, in _import_module_from_library file, path, description = imp.find_module(module_name, [path])

an-zi-li commented 2 years ago

I noticed that File "D:\pycharm_workspace\Files\stylegan2\op\fused_act.py", line 15, in os.path.join(module_path, "fused_bias_act_kernel.cu"), as you used Windows OS, may this module_path is not same as it in Linux?

And every step the script searches files may suffer from this issue, like the [path] in File "D:\anaconda\envs\torch151\lib\site-packages\torch\utils\cpp_extension.py", line 1441, in _import_module_from_library file, path, description = imp.find_module(module_name, [path])

Thank you for your reply. Now this problem has been solved. The specific method is in the link:https://animadversio.github.io/tech_note/debugging-stylegan2

zyainfal commented 2 years ago

Sounds Great!