rosinality / stylegan2-pytorch

Implementation of Analyzing and Improving the Image Quality of StyleGAN (StyleGAN 2) in PyTorch
MIT License
2.74k stars 623 forks source link

ImportError: No module named 'fused' #247

Open leonel-os opened 3 years ago

leonel-os commented 3 years ago

Hi I run the following command:

 python -m torch.distributed.launch --nproc_per_node=8 --master_port=5433 train.py --batch 16 ./dataset/stylegan2/bag_texture_mdb

I'm getting the following error:

*****************************************
Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.
*****************************************
Traceback (most recent call last):
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 960, in _build_extension_module
    check=True)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/subprocess.py", line 512, 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 "train.py", line 30, in <module>
    from op import conv2d_gradfix
  File "/home/jgutierrez/GAN2/stylegan2-pytorch/op/__init__.py", line 1, in <module>
    from .fused_act import FusedLeakyReLU, fused_leaky_relu
  File "/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_act.py", line 15, in <module>
    os.path.join(module_path, "fused_bias_act_kernel.cu"),
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 658, in load
    is_python_module)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 827, in _jit_compile
    with_cuda=with_cuda)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 880, in _write_ninja_file_and_build
    _build_extension_module(name, build_directory, verbose)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 973, in _build_extension_module
    raise RuntimeError(message)
RuntimeError: Error building extension 'fused': [1/2] /usr/bin/nvcc -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/include -isystem /home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/include/TH -isystem /home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/include/THC -isystem /home/jgutierrez/anaconda3/envs/unsup3d/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -std=c++11 -c /home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o
FAILED: fused_bias_act_kernel.cuda.o
/usr/bin/nvcc -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/include -isystem /home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/include/TH -isystem /home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/include/THC -isystem /home/jgutierrez/anaconda3/envs/unsup3d/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -std=c++11 -c /home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o
/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: a pointer to a bound function may only be used to call the function

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: type name is not allowed

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: expected an expression

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: a pointer to a bound function may only be used to call the function

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: type name is not allowed

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: expected an expression

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: a pointer to a bound function may only be used to call the function

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: type name is not allowed

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: expected an expression

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: a pointer to a bound function may only be used to call the function

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: type name is not allowed

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: expected an expression

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: a pointer to a bound function may only be used to call the function

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: type name is not allowed

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: expected an expression

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: a pointer to a bound function may only be used to call the function

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: type name is not allowed

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: expected an expression

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: a pointer to a bound function may only be used to call the function

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: type name is not allowed

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: expected an expression

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: a pointer to a bound function may only be used to call the function

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: type name is not allowed

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: expected an expression

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: a pointer to a bound function may only be used to call the function

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: type name is not allowed

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: expected an expression

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: a pointer to a bound function may only be used to call the function

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: type name is not allowed

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: expected an expression

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: a pointer to a bound function may only be used to call the function

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: type name is not allowed

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: expected an expression

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: a pointer to a bound function may only be used to call the function

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: type name is not allowed

/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_bias_act_kernel.cu(96): error: expected an expression

36 errors detected in the compilation of "/tmp/tmpxft_00005ce7_00000000-6_fused_bias_act_kernel.cpp1.ii".
ninja: build stopped: subcommand failed.

Traceback (most recent call last):
  File "train.py", line 30, in <module>
    from op import conv2d_gradfix
  File "/home/jgutierrez/GAN2/stylegan2-pytorch/op/__init__.py", line 1, in <module>
    from .fused_act import FusedLeakyReLU, fused_leaky_relu
  File "/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_act.py", line 15, in <module>
    os.path.join(module_path, "fused_bias_act_kernel.cu"),
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 658, in load
    is_python_module)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 838, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 978, in _import_module_from_library
    file, path, description = imp.find_module(module_name, [path])
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/imp.py", line 296, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'fused'
Traceback (most recent call last):
  File "train.py", line 30, in <module>
    from op import conv2d_gradfix
  File "/home/jgutierrez/GAN2/stylegan2-pytorch/op/__init__.py", line 1, in <module>
    from .fused_act import FusedLeakyReLU, fused_leaky_relu
  File "/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_act.py", line 15, in <module>
    os.path.join(module_path, "fused_bias_act_kernel.cu"),
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 658, in load
    is_python_module)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 838, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 978, in _import_module_from_library
    file, path, description = imp.find_module(module_name, [path])
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/imp.py", line 296, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'fused'
Traceback (most recent call last):
  File "train.py", line 30, in <module>
    from op import conv2d_gradfix
  File "/home/jgutierrez/GAN2/stylegan2-pytorch/op/__init__.py", line 1, in <module>
    from .fused_act import FusedLeakyReLU, fused_leaky_relu
  File "/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_act.py", line 15, in <module>
    os.path.join(module_path, "fused_bias_act_kernel.cu"),
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 658, in load
    is_python_module)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 838, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 978, in _import_module_from_library
    file, path, description = imp.find_module(module_name, [path])
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/imp.py", line 296, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'fused'
Traceback (most recent call last):
  File "train.py", line 30, in <module>
    from op import conv2d_gradfix
  File "/home/jgutierrez/GAN2/stylegan2-pytorch/op/__init__.py", line 1, in <module>
    from .fused_act import FusedLeakyReLU, fused_leaky_relu
  File "/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_act.py", line 15, in <module>
    os.path.join(module_path, "fused_bias_act_kernel.cu"),
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 658, in load
    is_python_module)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 838, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 978, in _import_module_from_library
    file, path, description = imp.find_module(module_name, [path])
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/imp.py", line 296, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'fused'
Traceback (most recent call last):
  File "train.py", line 30, in <module>
    from op import conv2d_gradfix
  File "/home/jgutierrez/GAN2/stylegan2-pytorch/op/__init__.py", line 1, in <module>
    from .fused_act import FusedLeakyReLU, fused_leaky_relu
  File "/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_act.py", line 15, in <module>
    os.path.join(module_path, "fused_bias_act_kernel.cu"),
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 658, in load
    is_python_module)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 838, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 978, in _import_module_from_library
    file, path, description = imp.find_module(module_name, [path])
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/imp.py", line 296, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'fused'
Traceback (most recent call last):
  File "train.py", line 30, in <module>
    from op import conv2d_gradfix
  File "/home/jgutierrez/GAN2/stylegan2-pytorch/op/__init__.py", line 1, in <module>
    from .fused_act import FusedLeakyReLU, fused_leaky_relu
  File "/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_act.py", line 15, in <module>
    os.path.join(module_path, "fused_bias_act_kernel.cu"),
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 658, in load
    is_python_module)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 838, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 978, in _import_module_from_library
Traceback (most recent call last):
  File "train.py", line 30, in <module>
        file, path, description = imp.find_module(module_name, [path])from op import conv2d_gradfix

  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/imp.py", line 296, in find_module
  File "/home/jgutierrez/GAN2/stylegan2-pytorch/op/__init__.py", line 1, in <module>
    from .fused_act import FusedLeakyReLU, fused_leaky_relu
  File "/home/jgutierrez/GAN2/stylegan2-pytorch/op/fused_act.py", line 15, in <module>
    os.path.join(module_path, "fused_bias_act_kernel.cu"),
    raise ImportError(_ERR_MSG.format(name), name=name)  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 658, in load

ImportError: No module named 'fused'
    is_python_module)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 838, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 978, in _import_module_from_library
    file, path, description = imp.find_module(module_name, [path])
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/imp.py", line 296, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'fused'
Traceback (most recent call last):
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/distributed/launch.py", line 246, in <module>
    main()
  File "/home/jgutierrez/anaconda3/envs/unsup3d/lib/python3.7/site-packages/torch/distributed/launch.py", line 242, in main
    cmd=cmd)
subprocess.CalledProcessError: Command '['/home/jgutierrez/anaconda3/envs/unsup3d/bin/python', '-u', 'train.py', '--local_rank=7', '--batch', '16', './dataset/stylegan2/bag_texture_mdb']' returned non-zero exit status 1.

Please, I need help. Thanks

rosinality commented 3 years ago

I think you may need to update your gcc.

Zhaiyan1996 commented 2 years ago

Hello,i have the same problem, but my gcc version is 9.3 . Update gcc is not helpful for me . I hope you can share some new idea about this, thanks !!!

Kai-0515 commented 2 years ago

Hello,i have the same problem, but my gcc version is 9.3 . Update gcc is not helpful for me . I hope you can share some new idea about this, thanks !!!

have u solved this problem, I have the same problem.