Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named 'fused' #12

Open
yytbupt opened this issue Dec 28, 2021 · 2 comments
Open

ImportError: No module named 'fused' #12

yytbupt opened this issue Dec 28, 2021 · 2 comments

Comments

@yytbupt
Copy link

yytbupt commented Dec 28, 2021

when i run the command:
python main.py --im_path1 90.png --im_path2 15.png --im_path3 117.png --sign realistic --smooth 5

i meet the following problem:

Traceback (most recent call last):
File "main.py", line 13, in
from models.Embedding import Embedding
File "/home/yaoyuntao/programs/Barbershop-main/models/Embedding.py", line 3, in
from models.Net import Net
File "/home/yaoyuntao/programs/Barbershop-main/models/Net.py", line 3, in
from models.stylegan2.model import Generator
File "/home/yaoyuntao/programs/Barbershop-main/models/stylegan2/model.py", line 11, in
from models.stylegan2.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
File "/home/yaoyuntao/programs/Barbershop-main/models/stylegan2/op/init.py", line 1, in
from .fused_act import FusedLeakyReLU, fused_leaky_relu
File "/home/yaoyuntao/programs/Barbershop-main/models/stylegan2/op/fused_act.py", line 14, in
os.path.join(module_path, "fused_bias_act_kernel.cu"),
File "/home/yaoyuntao/anaconda3/envs/Barbershop/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 997, in load
keep_intermediates=keep_intermediates)
File "/home/yaoyuntao/anaconda3/envs/Barbershop/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1213, in _jit_compile
return _import_module_from_library(name, build_directory, is_python_module)
File "/home/yaoyuntao/anaconda3/envs/Barbershop/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1560, in _import_module_from_library
file, path, description = imp.find_module(module_name, [path])
File "/home/yaoyuntao/anaconda3/envs/Barbershop/lib/python3.7/imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'fused'

who can tell me the reason? thanks

@ZPdesu
Copy link
Owner

ZPdesu commented Dec 28, 2021

It’s an environment problem. Please set up a new conda environment based on the environment.yml file.

@Praecordi
Copy link

I'm having this problem, but on windows. I run the same above command, and received the error:

(barbershop) C:\Users\SS\Documents\Barbershop>python main.py --im_path1 90.png --im_path2 15.png --im_path3 117.png --sign realistic --smooth 5
Traceback (most recent call last):
  File "C:\Users\SS\Documents\Barbershop\main.py", line 13, in <module>
    from models.Embedding import Embedding
  File "C:\Users\SS\Documents\Barbershop\models\Embedding.py", line 3, in <module>
    from models.Net import Net
  File "C:\Users\SS\Documents\Barbershop\models\Net.py", line 3, in <module>
    from models.stylegan2.model import Generator
  File "C:\Users\SS\Documents\Barbershop\models\stylegan2\model.py", line 11, in <module>
    from models.stylegan2.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
  File "C:\Users\SS\Documents\Barbershop\models\stylegan2\op\__init__.py", line 1, in <module>
    from .fused_act import FusedLeakyReLU, fused_leaky_relu
  File "C:\Users\SS\Documents\Barbershop\models\stylegan2\op\fused_act.py", line 10, in <module>
    fused = load(
  File "C:\Users\SS\AppData\Roaming\Python\Python310\site-packages\torch\utils\cpp_extension.py", line 1284, in load
    return _jit_compile(
  File "C:\Users\SS\AppData\Roaming\Python\Python310\site-packages\torch\utils\cpp_extension.py", line 1534, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
  File "C:\Users\SS\AppData\Roaming\Python\Python310\site-packages\torch\utils\cpp_extension.py", line 1936, 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 followed this in setting up my environment on windows. Can you give more details on what might be causing this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants