Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fail to import Renderer. How to solve this problem? #34

Closed
a139122679 opened this issue Dec 28, 2021 · 5 comments
Closed

fail to import Renderer. How to solve this problem? #34

a139122679 opened this issue Dec 28, 2021 · 5 comments

Comments

@a139122679
Copy link

fail to import Renderer.
INFO:utils.train_utils:log name: logs/pymaf_res50_mix/pymaf_res50_mix_as_lp3_mlp256-128-64-5_Dec28-10-52-18-ZWK
INFO:models.hmr:loaded resnet50 imagenet pretrained model
INFO:datasets.base_dataset:len of h36m: 312188
INFO:datasets.base_dataset:len of lsp-orig: 1000
INFO:datasets.base_dataset:len of mpii: 14810
INFO:datasets.base_dataset:len of lspet: 9428
INFO:datasets.base_dataset:len of coco: 28344
INFO:datasets.base_dataset:len of mpi-inf-3dhp: 96507
INFO:datasets.base_dataset:len of h36m-p2-mosh: 26859
No renderer for visualization.
Traceback (most recent call last):
File "train.py", line 69, in
main(None, ngpus_per_node, options)
File "train.py", line 37, in main
trainer = Trainer(options)
File "/user3/lwx1055260/ID2462_PyMAF_for_pytorch/core/base_trainer.py", line 28, in init
self.init_fn()
File "/user3/lwx1055260/ID2462_PyMAF_for_pytorch/core/trainer.py", line 143, in init_fn
self.iuv_maker = IUV_Renderer(output_size=cfg.MODEL.PyMAF.DP_HEATMAP_SIZE)
NameError: name 'IUV_Renderer' is not defined

@HongwenZhang
Copy link
Owner

IUV_Renderer is currently depended on neural_renderer.
If you fail to install neural_renderer, you can disable densepose rendering by setting --misc MODEL.PyMAF.AUX_SUPV_ON False.

@a139122679
Copy link
Author

Thank you for your reply. After the neural_renderer dependency is installed, A new problem has arisen.. The Pyrender dependency is installed successfully. I do not know why the error message "pyrender undefined" is reported. Please check it. Traceback (most recent call last):
File "train.py", line 9, in
from core.trainer import Trainer
File "/user3/lwx1055260/ID2462_PyMAF_for_pytorch/core/trainer.py", line 28, in
from utils.renderer import OpenDRenderer, IUV_Renderer
File "/user3/lwx1055260/ID2462_PyMAF_for_pytorch/utils/renderer.py", line 30, in
class WeakPerspectiveCamera(pyrender.Camera):
NameError: name 'pyrender' is not defined

@HongwenZhang
Copy link
Owner

It seems that the pyrender package is not successfully imported or installed.

@a139122679
Copy link
Author

It seems so, I removed the try method from your code, and now it's an error like this. Traceback (most recent call last):
File "/opt/conda/lib/python3.6/site-packages/PyOpenGL-3.1.0-py3.6.egg/OpenGL/platform/glx.py", line 17, in GL
mode=ctypes.RTLD_GLOBAL
File "/opt/conda/lib/python3.6/site-packages/PyOpenGL-3.1.0-py3.6.egg/OpenGL/platform/ctypesloader.py", line 45, in loadLibrary
return dllType( name, mode )
File "/opt/conda/lib/python3.6/ctypes/init.py", line 348, in init
self._handle = _dlopen(self._name, mode)
OSError: ('GL: cannot open shared object file: No such file or directory', 'GL', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "train.py", line 9, in
from core.trainer import Trainer
File "/user3/lwx1055260/ID2462_PyMAF_for_pytorch/core/trainer.py", line 28, in
from utils.renderer import OpenDRenderer, IUV_Renderer
File "/user3/lwx1055260/ID2462_PyMAF_for_pytorch/utils/renderer.py", line 21, in
import pyrender
File "/opt/conda/lib/python3.6/site-packages/pyrender/init.py", line 3, in
from .light import Light, PointLight, DirectionalLight, SpotLight
File "/opt/conda/lib/python3.6/site-packages/pyrender/light.py", line 10, in
from OpenGL.GL import *
File "/opt/conda/lib/python3.6/site-packages/PyOpenGL-3.1.0-py3.6.egg/OpenGL/GL/init.py", line 3, in
from OpenGL import error as _error
File "/opt/conda/lib/python3.6/site-packages/PyOpenGL-3.1.0-py3.6.egg/OpenGL/error.py", line 12, in
from OpenGL import platform, _configflags
File "/opt/conda/lib/python3.6/site-packages/PyOpenGL-3.1.0-py3.6.egg/OpenGL/platform/init.py", line 35, in
_load()
File "/opt/conda/lib/python3.6/site-packages/PyOpenGL-3.1.0-py3.6.egg/OpenGL/platform/init.py", line 32, in _load
plugin.install(globals())
File "/opt/conda/lib/python3.6/site-packages/PyOpenGL-3.1.0-py3.6.egg/OpenGL/platform/baseplatform.py", line 92, in install
namespace[ name ] = getattr(self,name,None)
File "/opt/conda/lib/python3.6/site-packages/PyOpenGL-3.1.0-py3.6.egg/OpenGL/platform/baseplatform.py", line 14, in get
value = self.fget( obj )
File "/opt/conda/lib/python3.6/site-packages/PyOpenGL-3.1.0-py3.6.egg/OpenGL/platform/glx.py", line 96, in GetCurrentContext
return self.GL.glXGetCurrentContext
File "/opt/conda/lib/python3.6/site-packages/PyOpenGL-3.1.0-py3.6.egg/OpenGL/platform/baseplatform.py", line 14, in get
value = self.fget( obj )
File "/opt/conda/lib/python3.6/site-packages/PyOpenGL-3.1.0-py3.6.egg/OpenGL/platform/glx.py", line 20, in GL
raise ImportError("Unable to load OpenGL library", *err.args)
ImportError: ('Unable to load OpenGL library', 'GL: cannot open shared object file: No such file or directory', 'GL', None)

@HongwenZhang
Copy link
Owner

We have only tested our code on Ubuntu. I have no idea about the above errors :(
You can also refer to the answers in Issue #20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants