Import neural_renderer.cuda.load_textures as load_textures_cuda ImportError: /home/mona/anaconda3/lib/python3.7/site-packages/neural_renderer/cuda/load_textures.cpython-37m-x86_64-linux-gnu.so: undefined symbol: THPVariableClass

username: Mona_Jalal
cooked: <p>Do you know how I could fix this? I am trying to use <a href="https://github.com/benjiebob/SMALViewer/issues/3" rel="nofollow noopener">benjiebob/SMALViewer#3</a> repo however I get error on neural_renderer port:</p>
<pre><code class="lang-auto">$ python smal_viewer.py 
Traceback (most recent call last):
  File "smal_viewer.py", line 2, in &lt;module&gt;
    import pyqt_viewer
  File "/home/mona/research/3danimals/SMALViewer/pyqt_viewer.py", line 13, in &lt;module&gt;
    from smal.smal3d_renderer import SMAL3DRenderer
  File "/home/mona/research/3danimals/SMALViewer/smal/smal3d_renderer.py", line 6, in &lt;module&gt;
    import neural_renderer as nr
  File "/home/mona/anaconda3/lib/python3.7/site-packages/neural_renderer/__init__.py", line 3, in &lt;module&gt;
    from .load_obj import load_obj
  File "/home/mona/anaconda3/lib/python3.7/site-packages/neural_renderer/load_obj.py", line 8, in &lt;module&gt;
    import neural_renderer.cuda.load_textures as load_textures_cuda
ImportError: /home/mona/anaconda3/lib/python3.7/site-packages/neural_renderer/cuda/load_textures.cpython-37m-x86_64-linux-gnu.so: undefined symbol: THPVariableClass
</code></pre>
<p>Here is some details:</p>
<pre><code class="lang-auto">$ python
Python 3.7.6 (default, Jan  8 2020, 19:59:22) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import torch
&gt;&gt;&gt; torch.__version__
'1.6.0'
&gt;&gt;&gt; torch.version.cuda
'10.1'
&gt;&gt;&gt; torch.cuda.is_available()
True


$ gcc --version
gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.1 LTS
Release:	20.04
Codename:	focal


</code></pre>
<p>Here’s the link to neural renderer in PyTorch <a href="https://github.com/daniilidis-group/neural_renderer/" rel="nofollow noopener">https://github.com/daniilidis-group/neural_renderer/</a></p>

username: Mona_Jalal
cooked: <p>I was able to fix this by first finding all the AT_CHECK and converting them to AT_ASSERT. Checking out the at_assert_fix didn’t solve the problem for me. I am using PyTorch 1.6 and CUDA 10.1</p>
<pre><code class="lang-auto">https://github.com/daniilidis-group/neural_renderer/search?q=AT_CHECK

(base) mona@mona:~/neural_renderer/neural_renderer/cuda$ vi create_texture_image_cuda.cpp 
(base) mona@mona:~/neural_renderer/neural_renderer/cuda$ vi load_textures_cuda.cpp 
(base) mona@mona:~/neural_renderer/neural_renderer/cuda$ vi rasterize_cuda.cpp 

(base) mona@mona:~/neural_renderer$ pip install .
Processing /home/mona/neural_renderer
Building wheels for collected packages: neural-renderer-pytorch
  Building wheel for neural-renderer-pytorch (setup.py) ... done
  Created wheel for neural-renderer-pytorch: filename=neural_renderer_pytorch-1.1.3-cp37-cp37m-linux_x86_64.whl size=6215781 sha256=fbd9e8ef7340fa71b9fcd69da8ee06a1079ebbe5b4c2c3ce92e8124bc8cea7c5
  Stored in directory: /tmp/pip-ephem-wheel-cache-tddilaof/wheels/c6/9b/9b/d2cda4f9ac2127278c21ea5c5e23c3354fe0e63365b7af7842
Successfully built neural-renderer-pytorch
Installing collected packages: neural-renderer-pytorch
Successfully installed neural-renderer-pytorch-1.1.3
(base) mona@mona:~/neural_renderer$ python examples/example1.py 
Drawing: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 90/90 [00:04&lt;00:00, 19.37it/s]

</code></pre>
<aside class="onebox githubissue">
  <header class="source">
      <a href="https://github.com/daniilidis-group/neural_renderer/issues/94" target="_blank" rel="nofollow noopener">github.com/daniilidis-group/neural_renderer</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 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/daniilidis-group/neural_renderer/issues/94" target="_blank" rel="nofollow noopener"> File "/home/mona/anaconda3/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1529, in _run_ninja_build         raise RuntimeError(message)     RuntimeError: Error compiling objects for extension</a>
    </h4>

    <div class="github-info">
      <div class="date">
        opened <span class="discourse-local-date" data-format="ll" data-date="2020-09-24" data-time="17:46:26" data-timezone="UTC">05:46PM - 24 Sep 20 UTC</span>
      </div>

        <div class="date">
          closed <span class="discourse-local-date" data-format="ll" data-date="2020-09-24" data-time="18:37:25" data-timezone="UTC">06:37PM - 24 Sep 20 UTC</span>
        </div>

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

<div class="github-row">
  <p class="github-content">(base) mona@mona:~/neural_renderer$ pip install .
Processing /home/mona/neural_renderer
Building wheels for collected packages: neural-renderer-pytorch
 Building wheel for neural-renderer-pytorch (setup.py) ... error
 ERROR: Command errored...</p>
</div>

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

  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>