NVlabs / stylegan3

Official PyTorch implementation of StyleGAN3
Other
6.43k stars 1.13k forks source link

UTF #69

Closed wangbang79408854 closed 2 years ago

wangbang79408854 commented 2 years ago

Describe the bug A clear and concise description of what the bug is. this is report: (stylegan3) λ python gen_images.py --outdir=out --trunc=1 --seeds=2 --network=https://api.ngc.nvidia.com/v2/models/nvidia/research/stylegan3/versions/1/files/stylegan 3-r-afhqv2-512x512.pkl Loading networks from "https://api.ngc.nvidia.com/v2/models/nvidia/research/stylegan3/versions/1/files/stylegan3-r-afhqv2-512x512.pkl"... Generating image for seed 2 (0/1) ... Setting up PyTorch plugin "bias_act_plugin"... D:\Program\Anaconda\envs\stylegan3\lib\site-packages\torch\utils\cpp_extension.py:304: UserWarning: Error checking compiler version for cl: 'utf-8' codec can't decode byte 0xd3 in position 0: invalid continuation byte warnings.warn(f'Error checking compiler version for {compiler}: {error}') Done. Setting up PyTorch plugin "filtered_lrelu_plugin"... Failed! Traceback (most recent call last): File "D:\Program\Anaconda\envs\stylegan3\lib\site-packages\torch\utils\cpp_extension.py", line 1667, in _run_ninja_build subprocess.run( File "D:\Program\Anaconda\envs\stylegan3\lib\subprocess.py", line 516, in run raise CalledProcessError(retcode, process.args, 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 "gen_images.py", line 143, in generate_images() # pylint: disable=no-value-for-parameter File "D:\Program\Anaconda\envs\stylegan3\lib\site-packages\click\core.py", line 1137, in call return self.main(args, kwargs) File "D:\Program\Anaconda\envs\stylegan3\lib\site-packages\click\core.py", line 1062, in main rv = self.invoke(ctx) File "D:\Program\Anaconda\envs\stylegan3\lib\site-packages\click\core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "D:\Program\Anaconda\envs\stylegan3\lib\site-packages\click\core.py", line 763, in invoke return __callback(args, kwargs) File "gen_images.py", line 135, in generate_images img = G(z, label, truncation_psi=truncation_psi, noise_mode=noise_mode) File "D:\Program\Anaconda\envs\stylegan3\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl result = self.forward(*input, *kwargs) File "", line 504, in forward File "D:\Program\Anaconda\envs\stylegan3\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl result = self.forward(input, kwargs) File "", line 463, in forward File "D:\Program\Anaconda\envs\stylegan3\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "", line 347, in forward File "D:\Gan\stylegan3\torch_utils\ops\filtered_lrelu.py", line 114, in filtered_lrelu if impl == 'cuda' and x.device.type == 'cuda' and _init(): File "D:\Gan\stylegan3\torch_utils\ops\filtered_lrelu.py", line 26, in _init _plugin = custom_ops.get_plugin( File "D:\Gan\stylegan3\torch_utils\custom_ops.py", line 136, in get_plugin torch.utils.cpp_extension.load(name=module_name, build_directory=cached_build_dir, File "D:\Program\Anaconda\envs\stylegan3\lib\site-packages\torch\utils\cpp_extension.py", line 1079, in load return _jit_compile( File "D:\Program\Anaconda\envs\stylegan3\lib\site-packages\torch\utils\cpp_extension.py", line 1292, in _jit_compile _write_ninja_file_and_build_library( File "D:\Program\Anaconda\envs\stylegan3\lib\site-packages\torch\utils\cpp_extension.py", line 1404, in _write_ninja_file_and_build_library _run_ninja_build( File "D:\Program\Anaconda\envs\stylegan3\lib\site-packages\torch\utils\cpp_extension.py", line 1682, in _run_ninja_build message += f": {error.output.decode()}" # type: ignore UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd3 in position 1617: invalid continuation byte

Desktop (please complete the following information):

YukiSakuma commented 2 years ago

Try editing the file: Lib\site-packages\torch\utils\_cpp_extension_versioner.py under the function def hash_source_files(hash_value, source_files):. Change the line with open(filename) as file: to with open(filename, errors='ignore') as file:

wodsoe commented 2 years ago

run "CHCP 65001" first.

wangbang79408854 commented 2 years ago

thanks it's work for me