NVlabs / stylegan2-ada-pytorch

StyleGAN2-ADA - Official PyTorch implementation
https://arxiv.org/abs/2006.06676
Other
4.08k stars 1.16k forks source link

UserWarning: Error checking compiler version for cl: 'utf-8' codec can't decode byte 0x8e in position 0: invalid start byte #48

Open Dok11 opened 3 years ago

Dok11 commented 3 years ago

Describe the bug

(stylegan2-ada) E:\Projects\stylegan2-ada>python ./stylegan2-ada/generate.py --outdir=out --seeds=0-35 --class=2 --network=https://nvlabs-fi-cdn.nvidia.com/stylegan2-ada-pytorch/pretrained/cifar10.pkl
Loading networks from "https://nvlabs-fi-cdn.nvidia.com/stylegan2-ada-pytorch/pretrained/cifar10.pkl"...
Generating image for seed 0 (0/36) ...
Setting up PyTorch plugin "bias_act_plugin"... C:\Users\oleg\AppData\Local\Continuum\anaconda3\envs\stylegan2-ada\lib\site-packages\torch\utils\cpp_extension.py:287: UserWarning: Error checking compiler version for cl: 'utf-8' codec can't decode byte 0x8e in position 0: invalid start byte
  warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
Done.
Setting up PyTorch plugin "upfirdn2d_plugin"... C:\Users\oleg\AppData\Local\Continuum\anaconda3\envs\stylegan2-ada\lib\site-packages\torch\utils\cpp_extension.py:287: UserWarning: Error checking compiler version for cl: 'utf-8' codec can't decode byte 0x8e in position 0: invalid start byte
  warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
Done.
Generating image for seed 1 (1/36) ...
Generating image for seed 2 (2/36) ...
Generating image for seed 3 (3/36) ...

Saw these warnings but images generated successfull

Desktop (please complete the following information):

nurpax commented 3 years ago

Probably crashing here in PyTorch:

    if sys.platform.startswith('darwin'):
        # There is no particular minimum version we need for clang, so we're good here.
        return True
    try:
        if sys.platform.startswith('linux'):
            minimum_required_version = MINIMUM_GCC_VERSION
            versionstr = subprocess.check_output([compiler, '-dumpfullversion', '-dumpversion'])
            version = versionstr.decode().strip().split('.')
        else:
            minimum_required_version = MINIMUM_MSVC_VERSION
            compiler_info = subprocess.check_output(compiler, stderr=subprocess.STDOUT)
            match = re.search(r'(\d+)\.(\d+)\.(\d+)', compiler_info.decode().strip())
            version = (0, 0, 0) if match is None else match.groups()
    except Exception:
        _, error, _ = sys.exc_info()
        warnings.warn(f'Error checking compiler version for {compiler}: {error}')
        return False

Could it be a locale thing? When you run MSVC (cl.exe) on the command line, does it print non-ASCII, non-UTF8 characters? That's what this "'utf-8' codec can't decode byte 0x8e in position 0: invalid start byte" error seems to suggest.

I don't have Windows to try this on. Seems like a bug in how PyTorch itself handles C++ extensions. That's where the error is coming from.

viktor02 commented 3 years ago

Try to set the encoding to utf8 before starting chcp 65001. Works fine in Windows Terminal.

yusufbtanriverdi commented 10 months ago

Probably crashing here in PyTorch:

    if sys.platform.startswith('darwin'):
        # There is no particular minimum version we need for clang, so we're good here.
        return True
    try:
        if sys.platform.startswith('linux'):
            minimum_required_version = MINIMUM_GCC_VERSION
            versionstr = subprocess.check_output([compiler, '-dumpfullversion', '-dumpversion'])
            version = versionstr.decode().strip().split('.')
        else:
            minimum_required_version = MINIMUM_MSVC_VERSION
            compiler_info = subprocess.check_output(compiler, stderr=subprocess.STDOUT)
            match = re.search(r'(\d+)\.(\d+)\.(\d+)', compiler_info.decode().strip())
            version = (0, 0, 0) if match is None else match.groups()
    except Exception:
        _, error, _ = sys.exc_info()
        warnings.warn(f'Error checking compiler version for {compiler}: {error}')
        return False

Could it be a locale thing? When you run MSVC (cl.exe) on the command line, does it print non-ASCII, non-UTF8 characters? That's what this "'utf-8' codec can't decode byte 0x8e in position 0: invalid start byte" error seems to suggest.

I don't have Windows to try this on. Seems like a bug in how PyTorch itself handles C++ extensions. That's where the error is coming from.

you can change the language pack in vs installer to remove special chars, it worked for me