You need to enable JavaScript to run this app. 运行SMALViewer时导入neural_renderer出现THPVariableClass未定义错误
优惠活动
大模型
产品
解决方案
定价
更多

运行SMALViewer时导入neural_renderer出现THPVariableClass未定义错误

问题描述
  • 操作目标:在本地运行SMALViewer程序,对应参考的仓库Issue地址为https://github.com/benjiebob/SMALViewer/issues/3
  • 故障触发点:程序启动流程中,导入neural_renderer依赖时抛出导入错误,无法正常进入主程序
  • 依赖安装方式:执行pip install neural_renderer_pytorch完成neural_renderer依赖的安装
  • 关联参考:neural_renderer官方代码仓库地址为https://github.com/daniilidis-group/neural_renderer,当前通过pip安装的版本存在导入异常,需要对应的修复方案
启动命令与完整报错栈

执行启动命令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 OR 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

内容的提问来源于stack exchange,提问作者Mona Jalal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.11.25 02:36:01