wildavatar / WildAvatar_Toolbox

[ArXiv 2024] WildAvatar: Web-scale In-the-wild Video Dataset for 3D Avatar Creation
https://wildavatar.github.io/
Other
82 stars 4 forks source link

AttributeError: 'NoneType' object has no attribute 'glGetError' #3

Open Kyfafyd opened 2 months ago

Kyfafyd commented 2 months ago

Hi, @wildavatar @Inso-13 thanks for your great work! I have strictly follow the instructions in the readme to build the environment. When I try to visualize SMPL with python vis_smpl.py --subject "QV_dRsaJlEU", I get the following error:

Traceback (most recent call last):
  File "/mnt/petrelfs/wangzhao/WildAvatar_Toolbox/vis_smpl.py", line 7, in <module>
    from utils.smpl_utils import Renderer
  File "/mnt/petrelfs/wangzhao/WildAvatar_Toolbox/utils/smpl_utils.py", line 4, in <module>
    import pyrender
  File "/mnt/petrelfs/wangzhao/anaconda3/envs/wildavatar/lib/python3.9/site-packages/pyrender/__init__.py", line 3, in <module>
    from .light import Light, PointLight, DirectionalLight, SpotLight
  File "/mnt/petrelfs/wangzhao/anaconda3/envs/wildavatar/lib/python3.9/site-packages/pyrender/light.py", line 11, in <module>
    from .texture import Texture
  File "/mnt/petrelfs/wangzhao/anaconda3/envs/wildavatar/lib/python3.9/site-packages/pyrender/texture.py", line 8, in <module>
    from OpenGL.GL import *
  File "/mnt/petrelfs/wangzhao/anaconda3/envs/wildavatar/lib/python3.9/site-packages/OpenGL/GL/__init__.py", line 4, in <module>
    from OpenGL.GL.VERSION.GL_1_1 import *
  File "/mnt/petrelfs/wangzhao/anaconda3/envs/wildavatar/lib/python3.9/site-packages/OpenGL/GL/VERSION/GL_1_1.py", line 14, in <module>
    from OpenGL.raw.GL.VERSION.GL_1_1 import *
  File "/mnt/petrelfs/wangzhao/anaconda3/envs/wildavatar/lib/python3.9/site-packages/OpenGL/raw/GL/VERSION/GL_1_1.py", line 7, in <module>
    from OpenGL.raw.GL import _errors
  File "/mnt/petrelfs/wangzhao/anaconda3/envs/wildavatar/lib/python3.9/site-packages/OpenGL/raw/GL/_errors.py", line 4, in <module>
    _error_checker = _ErrorChecker( _p, _p.GL.glGetError )
AttributeError: 'NoneType' object has no attribute 'glGetError'
wildavatar commented 2 months ago

Thanks for your interest! Some foundational libraries, such as Osmesa probably cause this issue. You can setup Osmesa by simply running

sudo apt update
sudo apt install llvm-6.0 freeglut3 freeglut3-dev
sudo apt install libosmesa6 libosmesa6-dev

More instructions can be found at https://pyrender.readthedocs.io/en/latest/install/index.html#installmesa.

If it does not work after installing osmesa, you can also try to reinstall pyrender==0.1.33 and pyopengl==3.1.4. If you still have any questions, feel free to contact us.

Kyfafyd commented 2 months ago

Thanks for your prompt reply! Unfortunately, I can not install with under root permission. I have tried to reinstall pyrender==0.1.33 and pyopengl==3.1.4, but meeting the same issue. Is there any other solutions?

wildavatar commented 2 months ago

There are two tips maybe useful: A. Using EGL. Instead of Osmesa, You can also try to use EGL, by replacing this line to

# os.environ['PYOPENGL_PLATFORM'] = 'osmesa'
os.environ['PYOPENGL_PLATFORM'] = 'egl'

B. Using X11 forward. You may try to run commands using X11 forward. For example, you can use MobaXterm to connect your headless server, and run the visualization code on its session.