Error setting up pytorch plugins

cltexe: <p>Windows 10 + CUDA 11.1 + pytorch 1.8.0 + vs2019(added to path)+ rtx 3060 + conda.</p>
<p>I’m trying to run</p>
<blockquote>
<p>“projector.py --outdir=out --target=mytargetimg.png <br>
–network=<a href="https://nvlabs-fi-cdn.nvidia.com/stylegan2-ada-pytorch/pretrained/ffhq.pkl" rel="noopener nofollow ugc">https://nvlabs-fi-cdn.nvidia.com/stylegan2-ada-pytorch/pretrained/ffhq.pkl</a>”</p>
</blockquote>
<p>in stylegan2ada implementation, but can’t past beyond this error:</p>
<pre><code class="lang-auto">Loading networks from "https://nvlabs-fi-cdn.nvidia.com/stylegan2-ada-pytorch/pretrained/ffhq.pkl"...
Computing W midpoint and stddev using 10000 samples...
Setting up PyTorch plugin "bias_act_plugin"... C:\Anaconda3\envs\sgan2ada\lib\site-packages\torch\utils\cpp_extension.py:304: UserWarning: Error checking compiler version for cl: 'utf-8' codec can't decode byte 0x87 in position 5: invalid start byte
  warnings.warn(f'Error checking compiler version for {compiler}: {error}')
Failed!
D:\sgan2ada\torch_utils\ops\bias_act.py:50: UserWarning: Failed to build CUDA kernels for bias_act. Falling back to slow reference implementation. Details:

Traceback (most recent call last):
  File "C:\Anaconda3\envs\sgan2ada\lib\site-packages\torch\utils\cpp_extension.py", line 1667, in _run_ninja_build
    subprocess.run(
  File "C:\Anaconda3\envs\sgan2ada\lib\subprocess.py", line 528, 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 "D:\sgan2ada\torch_utils\ops\bias_act.py", line 48, in _init
    _plugin = custom_ops.get_plugin('bias_act_plugin', sources=sources, extra_cuda_cflags=['--use_fast_math'])
  File "D:\sgan2ada\torch_utils\custom_ops.py", line 110, in get_plugin
    torch.utils.cpp_extension.load(name=module_name, verbose=verbose_build, sources=sources, **build_kwargs)
  File "C:\Anaconda3\envs\sgan2ada\lib\site-packages\torch\utils\cpp_extension.py", line 1079, in load
    return _jit_compile(
  File "C:\Anaconda3\envs\sgan2ada\lib\site-packages\torch\utils\cpp_extension.py", line 1292, in _jit_compile
    _write_ninja_file_and_build_library(
  File "C:\Anaconda3\envs\sgan2ada\lib\site-packages\torch\utils\cpp_extension.py", line 1404, in _write_ninja_file_and_build_library
    _run_ninja_build(
  File "C:\Anaconda3\envs\sgan2ada\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 0x8d in position 1233: invalid start byte

  warnings.warn('Failed to build CUDA kernels for bias_act. Falling back to slow reference implementation. Details:\n\n' + traceback.format_exc())
Setting up PyTorch plugin "upfirdn2d_plugin"...
</code></pre>
<p>Double checked all the variables. I even removed environment and tried on 1.7 and 1.9 and tried all relevant posts on github but still no luck. Any advice?</p>

ptrblck: <p>The error is raised due to a failure in the decoding. You could try to save the file as <code>'utf-8'</code> or check for any characters, which could yield this error. I think <code>0x87</code> would point to a <a href="https://www.fileformat.info/info/unicode/char/00c7/index.htm">cedilla</a>, so maybe you could check all files for this character.</p>

cltexe: <p>I added more error log but I doubt this has something to do with encoding as I downloaded file from github and did no changes on it. I simply do this on Ipython console:</p>
<p><code>%run projector.py --outdir=out --target=mytargetimg.png --network=https://nvlabs-fi-cdn.nvidia.com/stylegan2-ada-pytorch/pretrained/ffhq.pkl</code></p>
<p>Could this be related to system locale. Here is the output of cl.exe:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/e/d/eda110dfe6de4825bfe83c2365a4be3af9f219f5.png" data-download-href="https://discuss.pytorch.org/uploads/default/eda110dfe6de4825bfe83c2365a4be3af9f219f5" title="resim"><img src="https://discuss.pytorch.org/uploads/default/original/3X/e/d/eda110dfe6de4825bfe83c2365a4be3af9f219f5.png" alt="resim" data-base62-sha1="xUaf2FKCLtLELL2c2Y67YDmr8vH" width="690" height="339" data-dominant-color="141414"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">resim</span><span class="informations">983×483 10.9 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>I guess root cause is this:</p><aside class="onebox githubissue" data-onebox-src="https://github.com/NVlabs/stylegan2-ada-pytorch/issues/48">
  <header class="source">

      <a href="https://github.com/NVlabs/stylegan2-ada-pytorch/issues/48" target="_blank" rel="noopener nofollow ugc">github.com/NVlabs/stylegan2-ada-pytorch</a>
  </header>

  <article class="onebox-body">
    <div class="github-row">
  <div class="github-icon-container" title="Issue">
	  <svg width="60" height="60" class="github-icon" viewBox="0 0 14 16" aria-hidden="true"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg>
  </div>

  <div class="github-info-container">
    <h4>
      <a href="https://github.com/NVlabs/stylegan2-ada-pytorch/issues/48" target="_blank" rel="noopener nofollow ugc">UserWarning: Error checking compiler version for cl: 'utf-8' codec can't decode byte 0x8e in position 0: invalid start byte</a>
    </h4>

    <div class="github-info">
      <div class="date">
        opened <span class="discourse-local-date" data-format="ll" data-date="2021-02-21" data-time="23:02:02" data-timezone="UTC">11:02PM - 21 Feb 21 UTC</span>
      </div>


      <div class="user">
        <a href="https://github.com/Dok11" target="_blank" rel="noopener nofollow ugc">
          <img alt="Dok11" src="https://avatars.githubusercontent.com/u/2697890?v=4" class="onebox-avatar-inline" width="20" height="20">
          Dok11
        </a>
      </div>
    </div>

    <div class="labels">
    </div>
  </div>
</div>

  <div class="github-row">
    <p class="github-body-container">**Describe the bug**
```
(stylegan2-ada) E:\Projects\stylegan2-ada&gt;python ./st<span class="show-more-container"><a href="" rel="noopener" class="show-more">…</a></span><span class="excerpt hidden">ylegan2-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):**
 - OS: Windows 10
 - PyTorch version: 1.7.1
 - CUDA toolkit version: 11.0
 - NVIDIA driver version: 461.40
 - GPU RTX 2080
 - Docker: —</span></p>
  </div>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>