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

AttributeError: module 'distutils' has no attribute '_msvccompiler' #473

Open
deepakpf opened this issue Nov 8, 2024 · 3 comments
Open

Comments

@deepakpf
Copy link

deepakpf commented Nov 8, 2024

I have the following error. Please help me :(

C:\DragGAN>conda activate stylegan3

(stylegan3) C:\DragGAN>.\scripts\gui.bat
Loading "C:\DragGAN\checkpoints\stylegan2_lions_512_pytorch.pkl"... Done.
()
{'z_dim': 512, 'c_dim': 0, 'w_dim': 512, 'img_resolution': 512, 'img_channels': 3, 'mapping_kwargs': {'num_layers': 8, 'embed_features': None, 'layer_features': None, 'activation': 'lrelu', 'lr_multiplier': 0.01, 'w_avg_beta': 0.995}, 'synthesis_kwargs': {'channel_base': 32768, 'channel_max': 512, 'num_fp16_res': 0, 'conv_clamp': None, 'architecture': 'skip', 'resample_filter': [1, 3, 3, 1], 'use_noise': True, 'activation': 'lrelu'}}
Setting up PyTorch plugin "bias_act_plugin"... C:\Users\omnig.conda\envs\stylegan3\lib\site-packages\torch\utils\cpp_extension.py:1964: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation.
If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
warnings.warn(
Failed!

Traceback (most recent call last):
File "C:\DragGAN\viz\renderer.py", line 112, in render
self.init_network(res, **args)
File "C:\DragGAN\viz\renderer.py", line 249, in init_network
w = G.mapping(z, label, truncation_psi=trunc_psi, truncation_cutoff=trunc_cutoff)
File "C:\Users\omnig.conda\envs\stylegan3\lib\site-packages\torch\nn\modules\module.py", line 1736, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\omnig.conda\envs\stylegan3\lib\site-packages\torch\nn\modules\module.py", line 1747, in _call_impl
return forward_call(*args, **kwargs)
File "C:\DragGAN\training\networks_stylegan2.py", line 247, in forward
x = layer(x)
File "C:\Users\omnig.conda\envs\stylegan3\lib\site-packages\torch\nn\modules\module.py", line 1736, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\omnig.conda\envs\stylegan3\lib\site-packages\torch\nn\modules\module.py", line 1747, in _call_impl
return forward_call(*args, **kwargs)
File "C:\DragGAN\training\networks_stylegan2.py", line 125, in forward
x = bias_act.bias_act(x, b, act=self.activation)
File "C:\DragGAN\torch_utils\ops\bias_act.py", line 84, in bias_act
if impl == 'cuda' and x.device.type == 'cuda' and _init():
File "C:\DragGAN\torch_utils\ops\bias_act.py", line 41, in _init
_plugin = custom_ops.get_plugin(
File "C:\DragGAN\torch_utils\custom_ops.py", line 137, in get_plugin
torch.utils.cpp_extension.load(name=module_name, build_directory=cached_build_dir,
File "C:\Users\omnig.conda\envs\stylegan3\lib\site-packages\torch\utils\cpp_extension.py", line 1314, in load
return _jit_compile(
File "C:\Users\omnig.conda\envs\stylegan3\lib\site-packages\torch\utils\cpp_extension.py", line 1721, in _jit_compile
_write_ninja_file_and_build_library(
File "C:\Users\omnig.conda\envs\stylegan3\lib\site-packages\torch\utils\cpp_extension.py", line 1833, in _write_ninja_file_and_build_library
_run_ninja_build(
File "C:\Users\omnig.conda\envs\stylegan3\lib\site-packages\torch\utils\cpp_extension.py", line 2081, in _run_ninja_build
vc_env = distutils._msvccompiler._get_vc_env(plat_spec)
AttributeError: module 'distutils' has no attribute '_msvccompiler'

@Duanzqy
Copy link

Duanzqy commented Nov 22, 2024

I have the same problem, I follow this pytorch/pytorch#136489 , change the setuptools's version, it works!
pip install setuptools==72.1.0

@JeremyPanJD
Copy link

I have the same problem, I follow this pytorch/pytorch#136489 , change the setuptools's version, it works! pip install setuptools==72.1.0

You're saying, just run this in terminal?

@Duanzqy
Copy link

Duanzqy commented Nov 26, 2024

I have the same problem, I follow this pytorch/pytorch#136489 , change the setuptools's version, it works! pip install setuptools==72.1.0

You're saying, just run this in terminal?

Yes, I run this and then I can ran gui.bat

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