Code Monkey home page Code Monkey logo

Comments (21)

TimoBolkart avatar TimoBolkart commented on May 22, 2024 9

Adding following lines to the rendering.py seems to solve the problem for some people:

import os
os.environ['PYOPENGL_PLATFORM'] = 'egl' # Uncommnet this line while running remotely

I updated the script accordingly

from voca.

sultanovazamat avatar sultanovazamat commented on May 22, 2024 7

I'm trying to fix this problem. I think it's a problem of pyrender. I'm looking forward to getting help.

I found a solution:

  1. Firstly, follow the installation guide for OSMESA here;
  2. Secondly, use the code from here (original visualize_sequence.py throws a segmentation fault with osmesa, so I slightly modified it).

Hope it helps!

from voca.

Banayaki avatar Banayaki commented on May 22, 2024 2

I found the answer. Just use PYOPENGL_PLATFORM=osmesa. For example:
PYOPENGL_PLATFORM=osmesa python run_voca.py

from voca.

huybery avatar huybery commented on May 22, 2024

I guess it could be dump from the OpenGL version.
Here's my information:

>> glxinfo | grep OpenGL
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.8, 256 bits)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.2.0
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 11.2.0
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 11.2.0
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:

from voca.

huybery avatar huybery commented on May 22, 2024

I'm trying to fix this problem. I think it's a problem of pyrender. I'm looking forward to getting help.

cv2 >= 3
Traceback (most recent call last):
  File "/home/mesh/.virtualenvs/voca/lib/python3.6/site-packages/pyrender/platforms/pyglet.py", line 32, in init_context
    width=1, height=1)
  File "/home/mesh/.virtualenvs/voca/lib/python3.6/site-packages/pyglet/window/xlib/__init__.py", line 170, in __init__
    super(XlibWindow, self).__init__(*args, **kwargs)
  File "/home/mesh/.virtualenvs/voca/lib/python3.6/site-packages/pyglet/window/__init__.py", line 592, in __init__
    config = screen.get_best_config(config)
  File "/home/mesh/.virtualenvs/voca/lib/python3.6/site-packages/pyglet/canvas/base.py", line 197, in get_best_config
    raise window.NoSuchConfigException()
pyglet.window.NoSuchConfigException

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "run_training.py", line 94, in <module>
    main()
  File "run_training.py", line 91, in main
    model.train()
  File "/home/mesh/voca/utils/voca_model.py", line 189, in train
    , data_specifier='training')
  File "/home/mesh/voca/utils/voca_model.py", line 249, in _render_sequences
    self._render_helper(out_folder, data_specifier)
  File "/home/mesh/voca/utils/voca_model.py", line 274, in _render_helper
    self._render_sequences_helper(video_fname, raw_audio[i_seq], processed_audio[i_seq], templates[i_seq], vertices[i_seq], condition_idx)
  File "/home/mesh/voca/utils/voca_model.py", line 306, in _render_sequences_helper
    gt_img = render_mesh_helper(Mesh(seq_verts[i_frame], self.template_mesh.f), center)
  File "/home/mesh/voca/utils/rendering.py", line 108, in render_mesh_helper
    r = pyrender.OffscreenRenderer(viewport_width=frustum['width'], viewport_height=frustum['height'])
  File "/home/mesh/.virtualenvs/voca/lib/python3.6/site-packages/pyrender/offscreen.py", line 31, in __init__
    self._create()
  File "/home/mesh/.virtualenvs/voca/lib/python3.6/site-packages/pyrender/offscreen.py", line 134, in _create
    self._platform.init_context()
  File "/home/mesh/.virtualenvs/voca/lib/python3.6/site-packages/pyrender/platforms/pyglet.py", line 40, 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 ""

from voca.

Jumponthemoon avatar Jumponthemoon commented on May 22, 2024

Same problem.Don't know how to fix it.

from voca.

Jumponthemoon avatar Jumponthemoon commented on May 22, 2024

Are you running on a server as well?

from voca.

huybery avatar huybery commented on May 22, 2024

Are you running on a server as well?

yep, ubuntu 16.04.

from voca.

Banayaki avatar Banayaki commented on May 22, 2024

Are you running on a server as well?

yep, ubuntu 16.04.

The same

from voca.

TimoBolkart avatar TimoBolkart commented on May 22, 2024

Sorry, but I cannot reproduce the problem.
Just to clarify, you are all able to output the meshes but only the rendering is an issue @huybery @qianchenghao @Banayaki ?

from voca.

huybery avatar huybery commented on May 22, 2024

Sorry, but I cannot reproduce the problem.
Just to clarify, you are all able to output the meshes but only the rendering is an issue @huybery @qianchenghao @Banayaki ?

yes, the mesh could be generated, but the video can not be output.

from voca.

huybery avatar huybery commented on May 22, 2024

I found the answer. Just use PYOPENGL_PLATFORM=osmesa. For example:
PYOPENGL_PLATFORM=osmesa python run_voca.py

I have try it... it doesn't work..

from voca.

TimoBolkart avatar TimoBolkart commented on May 22, 2024

@huybery does a visualization with OpenGL work for you? I.e. are you able to load one of these meshes with the mesh package and visualize it? Something along these lines
from psbody.mesh import Mesh
mesh = Mesh(filename='xxxxxxxxxx.obj')
mesh.show()
Does this work?

from voca.

huybery avatar huybery commented on May 22, 2024

@huybery does a visualization with OpenGL work for you? I.e. are you able to load one of these meshes with the mesh package and visualize it? Something along these lines
from psbody.mesh import Mesh
mesh = Mesh(filename='xxxxxxxxxx.obj')
mesh.show()
Does this work?

yes, it works well. I can not generate video on ubuntu16.04, but I could do it on macos...

from voca.

plmsmile avatar plmsmile commented on May 22, 2024

I use my own wav files to run_voca.py. And I also meet a problem

Use standard file APIs to check for files with this prefix.
Traceback (most recent call last):
File "/Users/plm/app/anaconda3/envs/voca/lib/python3.6/site-packages/pyrender/platforms/pyglet_platform.py", line 32, in init_context
width=1, height=1)
File "/Users/plm/app/anaconda3/envs/voca/lib/python3.6/site-packages/pyglet/window/init.py", line 632, in init
self._create()
File "/Users/plm/app/anaconda3/envs/voca/lib/python3.6/site-packages/pyglet/window/cocoa/init.py", line 194, in create
self.context.attach(self.canvas)
File "/Users/plm/app/anaconda3/envs/voca/lib/python3.6/site-packages/pyglet/gl/cocoa.py", line 291, in attach
self.nscontext.setView(canvas.nsview)
AttributeError: 'NoneType' object has no attribute 'setView
'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "run_voca.py", line 45, in
inference(tf_model_fname, ds_fname, audio_fname, template_fname, condition_idx, out_path)
File "/Users/plm/pro/voca/utils/inference.py", line 112, in inference
render_sequence_meshes(audio_fname, predicted_vertices, template, out_path)
File "/Users/plm/pro/voca/utils/inference.py", line 70, in render_sequence_meshes
img = render_mesh_helper(Mesh(sequence_vertices[i_frame], template.f), center)
File "/Users/plm/pro/voca/utils/rendering.py", line 107, in render_mesh_helper
r = pyrender.OffscreenRenderer(viewport_width=frustum['width'], viewport_height=frustum['height'])
File "/Users/plm/app/anaconda3/envs/voca/lib/python3.6/site-packages/pyrender/offscreen.py", line 31, in init
self._create()
File "/Users/plm/app/anaconda3/envs/voca/lib/python3.6/site-packages/pyrender/offscreen.py", line 134, in _create
self.platform.init_context()
File "/Users/plm/app/anaconda3/envs/voca/lib/python3.6/site-packages/pyrender/platforms/pyglet_platform.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 "'NoneType' object has no attribute 'setView
'"

from voca.

tegusi avatar tegusi commented on May 22, 2024

I also met this problem... I logged with remote ssh with vglrun working well, it seems that the problem lies in rendering?

from voca.

TimoBolkart avatar TimoBolkart commented on May 22, 2024

@huybery @qianchenghao @plmsmile @tegusi by default executing run_voca.py outputs the animated meshes AND renders the meshes to a video using pyrender. Pyrender however seems to cause problems for several different configurations (e.g. when running remotely, etc.). I don't know how to fix this issue, but the rendering itself is not essential for running VOCA, as the meshes are output anyways. As a workaround, pull the newest changes and the script with --visualize False. This will solely output the meshes which then can be visualized or rendered with any other tool. Does this work for you?

from voca.

tegusi avatar tegusi commented on May 22, 2024

@huybery @qianchenghao @plmsmile @tegusi by default executing run_voca.py outputs the animated meshes AND renders the meshes to a video using pyrender. Pyrender however seems to cause problems for several different configurations (e.g. when running remotely, etc.). I don't know how to fix this issue, but the rendering itself is not essential for running VOCA, as the meshes are output anyways. As a workaround, pull the newest changes and the script with --visualize False. This will solely output the meshes which then can be visualized or rendered with any other tool. Does this work for you?

Thanks! It is a workaround for generating meshes while I am still seeking a tool to visualize them, do you have any suggestion?

from voca.

Changlin-Lee avatar Changlin-Lee commented on May 22, 2024

I'm trying to fix this problem. I think it's a problem of pyrender. I'm looking forward to getting help.

I found a solution:

  1. Firstly, follow the installation guide for OSMESA here;
  2. Secondly, use the code from here (original visualize_sequence.py throws a segmentation fault with osmesa, so I slightly modified it).

Hope it helps!

That's really help! Thanks!

from voca.

Adorablepet avatar Adorablepet commented on May 22, 2024

@sultanovazamat @Changlin-Lee I replaced visualize_sequence.py code with the deb file with osmesa installed. But I still get this kind of error(pyrender: Falied rendering frame). Is there anything else I need to correct? Thank you.

ubuntu 18.04
cuda 10.1

from voca.

joemaliszewski avatar joemaliszewski commented on May 22, 2024

I found the answer. Just use PYOPENGL_PLATFORM=osmesa. For example:
PYOPENGL_PLATFORM=osmesa python run_voca.py

WORKS for me :D

from voca.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.