DragGAN icon indicating copy to clipboard operation
DragGAN copied to clipboard

Setting up PyTorch plugin "bias_act_plugin"... Failed!

Open imfurkaann opened this issue 1 year ago • 14 comments

File under cache_dir (./checkpoints): ['stylegan2_elephants_512_pytorch.pkl', 'stylegan2_horses_256_pytorch.pkl', 'stylegan2_lions_512_pytorch.pkl', 'stylegan2-cat-config-f.pkl', 'stylegan2-ffhq-512x512.pkl', 'stylegan2_dogs_1024_pytorch.pkl', 'stylegan2-car-config-f.pkl', 'stylegan2-afhqcat-512x512.pkl'] Valid checkpoint file: {'stylegan2_elephants_512_pytorch': './checkpoints/stylegan2_elephants_512_pytorch.pkl', 'stylegan2_horses_256_pytorch': './checkpoints/stylegan2_horses_256_pytorch.pkl', 'stylegan 2_lions_512_pytorch': './checkpoints/stylegan2_lions_512_pytorch.pkl', 'stylegan2-cat-config-f': './checkpoints/stylegan2-cat-config-f.pkl', 'stylegan2-ffhq-512x512': './checkpoint s/stylegan2-ffhq-512x512.pkl', 'stylegan2_dogs_1024_pytorch': './checkpoints/stylegan2_dogs_1024_pytorch.pkl', 'stylegan2-car-config-f': './checkpoints/stylegan2-car-config-f.pkl', 'stylegan2-afhqcat-512x512': './checkpoints/stylegan2-afhqcat-512x512.pkl'} Loading "./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"... Failed! Traceback (most recent call last): File "/home/akilliceviribilisim/DragGAN/visualizer_drag_gradio.py", line 200, in global_state = init_images(global_state) File "/home/akilliceviribilisim/DragGAN/visualizer_drag_gradio.py", line 70, in init_images state['renderer'].init_network( File "/home/akilliceviribilisim/DragGAN/viz/renderer.py", line 248, in init_network w = G.mapping(z, label, truncation_psi=trunc_psi, truncation_cutoff=trunc_cutoff) File "/home/akilliceviribilisim/miniconda3/envs/stylegan3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl return forward_call(*input, **kwargs) File "/home/akilliceviribilisim/DragGAN/training/networks_stylegan2.py", line 247, in forward x = layer(x) File "/home/akilliceviribilisim/miniconda3/envs/stylegan3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl return forward_call(*input, **kwargs) File "/home/akilliceviribilisim/DragGAN/training/networks_stylegan2.py", line 125, in forward x = bias_act.bias_act(x, b, act=self.activation) File "/home/akilliceviribilisim/DragGAN/torch_utils/ops/bias_act.py", line 84, in bias_act if impl == 'cuda' and x.device.type == 'cuda' and _init(): File "/home/akilliceviribilisim/DragGAN/torch_utils/ops/bias_act.py", line 41, in _init _plugin = custom_ops.get_plugin( File "/home/akilliceviribilisim/DragGAN/torch_utils/custom_ops.py", line 136, in get_plugin torch.utils.cpp_extension.load(name=module_name, build_directory=cached_build_dir, File "/home/akilliceviribilisim/miniconda3/envs/stylegan3/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1080, in load return _jit_compile( File "/home/akilliceviribilisim/miniconda3/envs/stylegan3/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1293, in _jit_compile _write_ninja_file_and_build_library( File "/home/akilliceviribilisim/miniconda3/envs/stylegan3/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1379, in _write_ninja_file_and_build_library check_compiler_abi_compatibility(compiler) File "/home/akilliceviribilisim/miniconda3/envs/stylegan3/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 283, in check_compiler_abi_compatibility if not check_compiler_ok_for_platform(compiler): File "/home/akilliceviribilisim/miniconda3/envs/stylegan3/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 243, in check_compiler_ok_for_platform which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT) File "/home/akilliceviribilisim/miniconda3/envs/stylegan3/lib/python3.9/subprocess.py", line 424, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/home/akilliceviribilisim/miniconda3/envs/stylegan3/lib/python3.9/subprocess.py", line 528, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['which', 'c++']' returned non-zero exit status 1.

pls help me

imfurkaann avatar Jun 26 '23 14:06 imfurkaann

I have the same error, or at least similar - will try to make a docker file

+1

oracle9i88 avatar Jun 26 '23 15:06 oracle9i88

bias_act_plugin error. i think newest cuda toolkit version unsurpport this plugin.i used cuda toolkit 11.8,its work success.

D:\Download\DragGAN>nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Sep_21_10:41:10_Pacific_Daylight_Time_2022
Cuda compilation tools, release 11.8, V11.8.89
Build cuda_11.8.r11.8/compiler.31833905_0

D:\Download\DragGAN>sh gui.sh
Loading "D:\Download\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"... Done.
Setting up PyTorch plugin "upfirdn2d_plugin"... Done.

Popukok avatar Jun 26 '23 17:06 Popukok

update your cuda (mine 11.7) and it can be solved

yangmingzhuo avatar Jun 26 '23 17:06 yangmingzhuo

PS E:\DragGAN> & C:/Users/charl/miniconda3/envs/drag-gan/python.exe e:/DragGAN/visualizer_drag_gradio.py File under cache_dir (./checkpoints): ['stylegan2-afhqcat-512x512.pkl', 'stylegan2-car-config-f.pkl', 'stylegan2-cat-config-f.pkl', 'stylegan2-ffhq-512x512.pkl', 'stylegan2_dogs_1024_pytorch.pkl', 'stylegan2_elephants_512_pytorch.pkl', 'stylegan2_horses_256_pytorch.pkl', 'stylegan2_lions_512_pytorch.pkl'] Valid checkpoint file: {'stylegan2-afhqcat-512x512': './checkpoints\stylegan2-afhqcat-512x512.pkl', 'stylegan2-car-config-f': './checkpoints\stylegan2-car-config-f.pkl', 'stylegan2-cat-config-f': './checkpoints\stylegan2-cat-config-f.pkl', 'stylegan2-ffhq-512x512': './checkpoints\stylegan2-ffhq-512x512.pkl', 'stylegan2_dogs_1024_pytorch': './checkpoints\stylegan2_dogs_1024_pytorch.pkl', 'stylegan2_elephants_512_pytorch': './checkpoints\stylegan2_elephants_512_pytorch.pkl', 'stylegan2_horses_256_pytorch': './checkpoints\stylegan2_horses_256_pytorch.pkl', 'stylegan2_lions_512_pytorch': './checkpoints\stylegan2_lions_512_pytorch.pkl'} Loading "./checkpoints\stylegan2_dogs_1024_pytorch.pkl"... Done. () {'z_dim': 512, 'c_dim': 0, 'w_dim': 512, 'img_resolution': 1024, '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"... Failed! Traceback (most recent call last): File "e:\DragGAN\visualizer_drag_gradio.py", line 208, in global_state = init_images(global_state) File "e:\DragGAN\visualizer_drag_gradio.py", line 76, in init_images state["renderer"].init_network( File "e:\DragGAN\viz\renderer.py", line 248, in init_network w = G.mapping(z, label, truncation_psi=trunc_psi, truncation_cutoff=trunc_cutoff) File "C:\Users\charl\miniconda3\envs\drag-gan\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl return forward_call(*args, **kwargs) File "e:\DragGAN\training\networks_stylegan2.py", line 247, in forward x = layer(x) File "C:\Users\charl\miniconda3\envs\drag-gan\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl return forward_call(*args, **kwargs) File "e:\DragGAN\training\networks_stylegan2.py", line 125, in forward x = bias_act.bias_act(x, b, act=self.activation) File "e:\DragGAN\torch_utils\ops\bias_act.py", line 84, in bias_act if impl == 'cuda' and x.device.type == 'cuda' and _init(): File "e:\DragGAN\torch_utils\ops\bias_act.py", line 41, in _init _plugin = custom_ops.get_plugin( File "e:\DragGAN\torch_utils\custom_ops.py", line 84, in get_plugin raise RuntimeError(f'Could not find MSVC/GCC/CLANG installation on this computer. Check _find_compiler_bindir() in "{file}".') RuntimeError: Could not find MSVC/GCC/CLANG installation on this computer. Check _find_compiler_bindir() in "e:\DragGAN\torch_utils\custom_ops.py".

I cannot pass Setting up PyTorch plugin "bias_act_plugin"

My cuda version is the same, nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Wed_Sep_21_10:41:10_Pacific_Daylight_Time_2022 Cuda compilation tools, release 11.8, V11.8.89 Build cuda_11.8.r11.8/compiler.31833905_0

Can anyone please help me

LiJT avatar Jun 27 '23 03:06 LiJT

直接更新到11.7就好了 去官方英伟达官网下一下就好

ShawnDen-coder avatar Jun 27 '23 04:06 ShawnDen-coder

直接使用stylegan3的镜像进行,省的自己升级cuda docker pull maximedurand/stylegan3:latest

LianShuaiLong avatar Jun 27 '23 06:06 LianShuaiLong

直接使用stylegan3的镜像进行,省的自己升级cuda docker pull maximedurand/stylegan3:latest

大哥你成功用起来了吗

limumua avatar Jun 27 '23 06:06 limumua

直接使用stylegan3的镜像进行,省的自己升级cuda docker pull maximedurand/stylegan3:latest

我拉了你说的这个镜像,我进入容器但是没法使用gpu呢 image

limumua avatar Jun 27 '23 07:06 limumua

直接使用stylegan3的镜像进行,省的自己升级cuda docker pull maximedurand/stylegan3:latest

我拉了你说的这个镜像,我进入容器但是没法使用gpu呢 image

可以用啊,是不是的cuda驱动版本的问题?

LianShuaiLong avatar Jun 27 '23 07:06 LianShuaiLong

Manually install CUDA11.8 version,

● Uninstall first pip3 uninstall torch torchvision torchaudio

● Reinstall again pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

chwshuang avatar Jun 27 '23 07:06 chwshuang

直接使用stylegan3的镜像进行,省的自己升级cuda docker pull maximedurand/stylegan3:latest

我拉了你说的这个镜像,我进入容器但是没法使用gpu呢 image

可以用啊,是不是的cuda驱动版本的问题?

我用起来了,前面的问题解决了,但是又来了新问题/(ㄒoㄒ)/~~ 我的是Ubuntu20.04,4090,nvcc是11.8的 image

limumua avatar Jun 27 '23 08:06 limumua

直接使用stylegan3的镜像进行,省的自己升级cuda docker pull maximedurand/stylegan3:latest

我拉了你说的这个镜像,我进入容器但是没法使用gpu呢 image

可以用啊,是不是的cuda驱动版本的问题?

我用起来了,前面的问题解决了,但是又来了新问题/(ㄒoㄒ)/~~ 我的是Ubuntu20.04,4090,nvcc是11.8的 image 没找到对应的字体文件吧,下一个字体放到对应的文件夹下面

LianShuaiLong avatar Jun 27 '23 08:06 LianShuaiLong

直接使用stylegan3的镜像进行,省的自己升级cuda docker pull maximedurand/stylegan3:latest

我拉了你说的这个镜像,我进入容器但是没法使用gpu呢 image

可以用啊,是不是的cuda驱动版本的问题?

我用起来了,前面的问题解决了,但是又来了新问题/(ㄒoㄒ)/~~ 我的是Ubuntu20.04,4090,nvcc是11.8的 image 没找到对应的字体文件吧,下一个字体放到对应的文件夹下面

大哥!我用起来了,但是这个登录是要去哪里注册账号吗 image

limumua avatar Jun 27 '23 08:06 limumua