radekd91 / inferno

🔥🔥🔥 Set the world of 3D faces on fire with INFERNO 🔥🔥🔥
Other
134 stars 14 forks source link

Error when running demo? #7

Open salahzoubi opened 5 months ago

salahzoubi commented 5 months ago

Followed all the instructions to get the environment running, I've also ran the submodules (optional) script at the start of the instructions. Whenever I try to run the demo, I get the following:

Could not import SPECTRE. Make sure you pull the repository with submodules to enable SPECTRE. Traceback (most recent call last): File "/home/ubuntu/inferno/inferno/models/temporal/external/SpectrePreprocessor.py", line 16, in from spectre.src.spectre import SPECTRE ModuleNotFoundError: No module named 'spectre'

Could not import EmoSwinModule. SWIN models will not be available. Make sure you pull the repository with submodules to enable SWIN. Could not import EmoSwinModule. SWIN models will not be available. Make sure you pull the repository with submodules to enable SWIN. SWIN not found, will not be able to use SWIN models Traceback (most recent call last): File "demos/demo_eval_talking_head_on_audio.py", line 21, in from inferno_apps.TalkingHead.evaluation.evaluation_functions import File "/home/ubuntu/inferno/inferno_apps/TalkingHead/evaluation/evaluation_functions.py", line 35, in from psbody.mesh import Mesh File "/home/ubuntu/miniconda3/envs/work38/lib/python3.8/site-packages/psbody/mesh/init.py", line 10, in from .meshviewer import MeshViewer, MeshViewers File "/home/ubuntu/miniconda3/envs/work38/lib/python3.8/site-packages/psbody/mesh/meshviewer.py", line 49, in from OpenGL import GL, GLU, GLUT File "/home/ubuntu/miniconda3/envs/work38/lib/python3.8/site-packages/OpenGL/GLUT/init.py", line 5, in from OpenGL.GLUT.fonts import File "/home/ubuntu/miniconda3/envs/work38/lib/python3.8/site-packages/OpenGL/GLUT/fonts.py", line 20, in p = platform.getGLUTFontPointer( name ) File "/home/ubuntu/miniconda3/envs/work38/lib/python3.8/site-packages/OpenGL/platform/baseplatform.py", line 350, in getGLUTFontPointer raise NotImplementedError( NotImplementedError: Platform does not define a GLUT font retrieval function

Any suggestions where I may be going wrong? Thank you!

radekd91 commented 5 months ago

@salahzoubi , thanks for your interest.

SPECTRE should not be necessary to run the model so you can ignore that error.

It seems your error comes from a problem with OpenGL. This can be a tricky part and I can only provide limited assistance there.
What platform are you on? The codebase was tested on Ubuntu 20.04 with OpenGL and also on headless Ubuntu with EGL.

It appears your platform doesn't have either. What platform are you on? Is it headless? What is the value of the DISPLAY env variable?

The code won't be runnable if OpenGL is not set up properly. If you want to bypass opengl, this is doable. The code only uses it for final visualizations. You can try commenting out the import to psbody.mesh and dump the meshes in some other way.

salahzoubi commented 5 months ago

Thanks for getting back to me so quickly @radekd91.

I'm running headless Ubuntu 20.04 (EC2 instance) with no DISPLAY variable (returns nothing since its a remote server). What would be the best course of action in this case?

radekd91 commented 5 months ago

This is tricky. There's a few ways forward.

1) somehow install EGL on your headless instance 2) try to use virtual display and non accelerated opengl rendering 3) comment out the rendering import and only dump meshes or find another way to render, such as using pytorch3D

No way out I'm afraid. OpenGL and headless servers are not always best friends

On Tue, Jan 16, 2024, 01:16 Salah Alzubi @.***> wrote:

Thanks for getting back to me so quickly @radekd91 https://github.com/radekd91.

I'm running headless Ubuntu 20.04 (EC2 instance) with no DISPLAY variable (returns nothing since its a remote server). What would be the best course of action in this case?

— Reply to this email directly, view it on GitHub https://github.com/radekd91/inferno/issues/7#issuecomment-1893345409, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7MKHKEH6N6AQ5XFU67TZLYOZAPZAVCNFSM6AAAAABB3MLLVCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJTGM2DKNBQHE . You are receiving this because you were mentioned.Message ID: @.***>

salahzoubi commented 5 months ago

I see, regarding point (2), would something like -X work? And regarding point (3) which file would I be commenting the rendering import out of? I'm currently just trying to run the demo...

Will try installing EGL as a first approach.

Thanks a ton for your help!

radekd91 commented 5 months ago

So I pushed a small fix, please reinstall the psbody-mesh library from the following repo:

pip install git+https://github.com/radek91/mesh.git@fix/openGLunavailable

It won't enable OpenGL but at least the psbody-mesh Mesh class will work even if OpenGL fails

cucdengjunli commented 2 months ago

mark

zhangliyun9120 commented 1 month ago

So I pushed a small fix, please reinstall the psbody-mesh library from the following repo:

pip install git+https://github.com/radek91/mesh.git@fix/openGLunavailable

It won't enable OpenGL but at least the psbody-mesh Mesh class will work even if OpenGL fails

the correct cmd should be "radekd91" not "radek91" ...