Closed redorangeyellowy closed 2 years ago
Did you run the codes on a machine without a display device?
Yes, I accessed the server through ssh and executed the code.
Can't I save the rendering result as an image file and check it without display device?
Try toswitch egl to osmesa in here: https://github.com/facebookresearch/InterHand2.6M/blob/2b8061d2c8e762aa6fcb8e6f5d18f8a9e83bfd0c/tool/MANO_render/render.py#L9
When I switch egl
to osmesa
, the following error occured:
Traceback (most recent call last):
File "render.py", line 11, in <module>
import pyrender
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/pyrender/__init__.py", line 3, in <module>
from .light import Light, PointLight, DirectionalLight, SpotLight
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/pyrender/light.py", line 10, in <module>
from OpenGL.GL import *
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/OpenGL/GL/__init__.py", line 3, in <module>
from OpenGL import error as _error
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/OpenGL/error.py", line 12, in <module>
from OpenGL import platform, _configflags
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/OpenGL/platform/__init__.py", line 35, in <module>
_load()
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/OpenGL/platform/__init__.py", line 32, in _load
plugin.install(globals())
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 92, in install
namespace[ name ] = getattr(self,name,None)
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 14, in __get__
value = self.fget( obj )
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/OpenGL/platform/osmesa.py", line 66, in GetCurrentContext
function = self.OSMesa.OSMesaGetCurrentContext
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 14, in __get__
value = self.fget( obj )
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/OpenGL/platform/osmesa.py", line 60, in OSMesa
def OSMesa( self ): return self.GL
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 14, in __get__
value = self.fget( obj )
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/OpenGL/platform/osmesa.py", line 28, in GL
raise ImportError("Unable to load OpenGL library", *err.args)
ImportError: ('Unable to load OpenGL library', 'OSMesa: cannot open shared object file: No such file or directory', 'OSMesa', None)
So, I tried to googling and it was said that the command sudo apt-get install libosmesa6-dev
solves the error, but as a result of the execution, the following error occurred:
Traceback (most recent call last):
File "render.py", line 104, in <module>
renderer = pyrender.OffscreenRenderer(viewport_width=img_width, viewport_height=img_height, point_size=1.0)
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/pyrender/offscreen.py", line 31, in __init__
self._create()
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/pyrender/offscreen.py", line 149, in _create
self._platform.init_context()
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/pyrender/platforms/osmesa.py", line 19, in init_context
from OpenGL.osmesa import (
ImportError: cannot import name 'OSMesaCreateContextAttribs' from 'OpenGL.osmesa' (/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/OpenGL/osmesa/__init__.py)
As a result of googling again, it was determined that the above error was caused by a PyOpenGL version compatibility problem. So after upgrading it to 3.1.5 version, render.py
was run. As a result, the following error occurred:
Traceback (most recent call last):
File "render.py", line 112, in <module>
renderer = pyrender.OffscreenRenderer(viewport_width=img_width, viewport_height=img_height, point_size=1.0)
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/pyrender/offscreen.py", line 31, in __init__
self._create()
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/pyrender/offscreen.py", line 150, in _create
self._platform.make_current()
File "/home/abc/miniconda3/envs/interhand/lib/python3.7/site-packages/pyrender/platforms/osmesa.py", line 44, in make_current
self.viewport_width, self.viewport_height
AssertionError
Do you have any other ideas on what to do?
Maybe you should try the rendering on a device with monitor :( Usually, you can render images on a devixe without moninor by switching egl to osmesa
Okay, but thank you for your help.
Thank you for your great work.
When you run the
render.py
file, the following error occurs.It's hard to find a clear problem even if I google it. Can you tell me why this problem is happening?