你知道我怎样才能解决这个问题吗?我试图使用https://github.com/benjiebob/SMALViewer/issues/3repo,但在neural_渲染器端口上出现错误:
$ python smal_viewer.py
Traceback (most recent call last):
File "smal_viewer.py", line 2, in <module>
import pyqt_viewer
File "/home/mona/research/3danimals/SMALViewer/pyqt_viewer.py", line 13, in <module>
from smal.smal3d_renderer import SMAL3DRenderer
File "/home/mona/research/3danimals/SMALViewer/smal/smal3d_renderer.py", line 6, in <module>
import neural_renderer as nr
File "/home/mona/anaconda3/lib/python3.7/site-packages/neural_renderer/__init__.py", line 3, in <module>
from .load_obj import load_obj
File "/home/mona/anaconda3/lib/python3.7/site-packages/neural_renderer/load_obj.py", line 8, in <module>
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
以下是一些细节:
$ 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.
>>> import torch
>>> torch.__version__
'1.6.0'
>>> torch.version.cuda
'10.1'
>>> 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
LSB Version: core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
这是神经渲染器git repo:https://github.com/daniilidis-group/neural_renderer
我使用pip install neural_renderer_pytorch
安装了神经渲染器
我首先找到所有的
AT_CHECK
并将它们转换为AT_ASSERT
,从而解决了这个问题。检查at_assert_fix
分支并没有为我解决问题。我正在使用PyTorch 1.6和CUDA 10.1https://github.com/daniilidis-group/neural_renderer/search?q=AT_CHECK
https://github.com/daniilidis-group/neural_renderer/issues/94
看起来你不是自己造的
neural_renderer_pytorch
,而是用了一个轮子。但是,此控制盘是使用较旧的pytorch
版本构建的,不能与计算机上当前的pytorch
版本一起使用使用当前的pytorch版本,即
它应该会起作用
在pytorch 1.5之前,它使用了一种在Linux上构建扩展的脆弱方式:尽管依赖于^{} ,但扩展并没有显式地链接到
libtorch.so
。提供缺少的符号只是因为import torch
用RTLD_GLOBAL
加载了libtorch.so
,从而使其符号全局可见/可访问-这就是为什么在加载这些扩展之前(例如neural_renderer_pytorch
像here),必须导入torch
的原因在第一次导入
torch
之前,可以强制执行旧的行为设置RTLD_GLOBAL
,以进行导入:然而,使用
RTLD_GLOBAL
是相当危险的,因为它可能插入不相关的符号,并导致微妙的错误甚至崩溃因此,由于1.5 pytorch不再使用
RTLD_GLOBAL
,而是显式地针对libpytorch.so
(参见此commit)的链接和使用旧pytorch版本构建的扩展将无法工作相关问题 更多 >
编程相关推荐