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

Render error when running demo.py #41

Closed
cenalzw opened this issue Jan 8, 2020 · 5 comments
Closed

Render error when running demo.py #41

cenalzw opened this issue Jan 8, 2020 · 5 comments

Comments

@cenalzw
Copy link

cenalzw commented Jan 8, 2020

Hi! Thank you for sharing your code! I guess that I installed the necessary environment and put SMPL models into the right path. While I experienced this error when I run the demo.py on my ssh terminal:

Traceback (most recent call last):
File "/home/zwliu/local/spin/lib/python3.6/site-packages/pyrender/platforms/pyglet.py", line 32, in init_context
width=1, height=1)
File "/home/zwliu/local/spin/lib/python3.6/site-packages/pyglet/window/xlib/init.py", line 170, in init
super(XlibWindow, self).init(*args, **kwargs)
File "/home/zwliu/local/spin/lib/python3.6/site-packages/pyglet/window/init.py", line 573, in init
display = pyglet.canvas.get_display()
File "/home/zwliu/local/spin/lib/python3.6/site-packages/pyglet/canvas/init.py", line 95, in get_display
return Display()
File "/home/zwliu/local/spin/lib/python3.6/site-packages/pyglet/canvas/xlib.py", line 119, in init
raise NoSuchDisplayException('Cannot connect to "%s"' % name)
pyglet.canvas.xlib.NoSuchDisplayException: Cannot connect to "None"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "demo.py", line 115, in
renderer = Renderer(focal_length=constants.FOCAL_LENGTH, img_res=constants.IMG_RES, faces=smpl.faces)
File "/home/zwliu/workspace/human_3d_modeling_work/SPIN/utils/renderer.py", line 17, in init
point_size=1.0)
File "/home/zwliu/local/spin/lib/python3.6/site-packages/pyrender/offscreen.py", line 31, in init
self._create()
File "/home/zwliu/local/spin/lib/python3.6/site-packages/pyrender/offscreen.py", line 134, in _create
self._platform.init_context()
File "/home/zwliu/local/spin/lib/python3.6/site-packages/pyrender/platforms/pyglet.py", line 38, in init_context
'internal error message was "{}"'.format(e)
ValueError: Failed to initialize Pyglet window with an OpenGL >= 3+ context. If you're logged in via SSH, ensure that you're running your script with vglrun (i.e. VirtualGL). The internal error message was "Cannot connect to "None""

I have no idea to deal with that error. I will really appreciate if I can get any help. Thanks a lot !

@nkolot
Copy link
Owner

nkolot commented Jan 9, 2020

Are you using OSMesa? Or you commented out the relevant line as suggested here?

@cenalzw
Copy link
Author

cenalzw commented Jan 15, 2020

@nkolot Thanks for your answer, I already fix this issue by following the right installation instructions.

@cenalzw cenalzw closed this as completed Jan 15, 2020
@ikvision
Copy link
Contributor

As an alternative to SPIN virtual_env one can use VIBE virtual_env:
https://github.com/mkocabas/VIBE/blob/master/install_pip.sh
and use
os.environ['PYOPENGL_PLATFORM'] = 'egl'
To run SPIN demo.py with rendering

@Jumponthemoon
Copy link

@nkolot Thanks for your answer, I already fix this issue by following the right installation instructions.

You mean install the OpenGL?How did you do the right installation?

@Vincent-2017
Copy link

As an alternative to SPIN virtual_env one can use VIBE virtual_env:
https://github.com/mkocabas/VIBE/blob/master/install_pip.sh
and use
os.environ['PYOPENGL_PLATFORM'] = 'egl'
To run SPIN demo.py with rendering

It is not useful for me

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

5 participants