OpenGL.error.GLError: GLError( err = 12289, baseOperation = eglInitialize, cArguments = ( <OpenGL._opaque.EGLDisplay_pointer object at 0x7f7565840040>, c_long(0), c_long(0), ), result = 0 ) libEGL warning: DRI2: failed to create dri screen libEGL warning: Not allowed to force software rendering when API explicitly selects a hardware device.
I get the following error when running it for a folder with only one image:
(expose) mona@goku:~/research/code/expose$ python demo.py --image-folder ~/Downloads/sample1 --exp-cfg data/conf.yaml --show=True --output-folder ~/Downloads/sample_out --save-params True --save-vis True --save-mesh True
INFO - 2021-01-29 16:33:41,267 - acceleratesupport - No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate'
Processing with R-CNN: 100%|█████████████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00, 1.74s/it]
2021-01-29 16:33:46.356 | INFO | __main__:main:241 - Saving results to: /home/mona/Downloads/sample_out
2021-01-29 16:33:46.359 | WARNING | expose.models.attention.predictor:__init__:91 - Apply hand network on body: True
2021-01-29 16:33:46.359 | WARNING | expose.models.attention.predictor:__init__:93 - Apply hand network on hands: True
2021-01-29 16:33:46.360 | WARNING | expose.models.attention.predictor:__init__:95 - Predict hands: True
2021-01-29 16:33:46.360 | WARNING | expose.models.attention.predictor:__init__:102 - Predict head: True
2021-01-29 16:33:46.360 | INFO | expose.models.attention.predictor:__init__:109 - Condition hand on body: True
2021-01-29 16:33:46.360 | INFO | expose.models.attention.predictor:__init__:112 - Condition hand wrist pose on body: True
2021-01-29 16:33:46.360 | INFO | expose.models.attention.predictor:__init__:117 - Condition hand finger pose on body: True
2021-01-29 16:33:46.360 | INFO | expose.models.attention.predictor:__init__:121 - Condition hand shape on body shape: False
2021-01-29 16:33:46.360 | INFO | expose.models.attention.predictor:__init__:169 - Condition head on body: True
2021-01-29 16:33:46.360 | INFO | expose.models.attention.predictor:__init__:170 - Condition expression on body: True
2021-01-29 16:33:46.360 | INFO | expose.models.attention.predictor:__init__:172 - Condition shape on body: False
2021-01-29 16:33:46.360 | INFO | expose.models.attention.predictor:__init__:173 - Condition neck pose on body: False
2021-01-29 16:33:46.360 | INFO | expose.models.attention.predictor:__init__:175 - Condition jaw pose on body: True
2021-01-29 16:33:46.987 | INFO | expose.models.attention.predictor:__init__:252 - Body model: SMPLXLayer(
Gender: NEUTRAL
Number of joints: 55
Betas: 10
Number of PCA components: 6
Flat hand mean: False
Number of Expression Coefficients: 10
(vertex_joint_selector): VertexJointSelector()
2021-01-29 16:33:47.343 | INFO | expose.models.backbone.hrnet:init_weights:487 - => init weights from normal distribution
2021-01-29 16:33:47.980 | WARNING | expose.models.backbone.hrnet:load_weights:519 - => please download pre-trained models first!
2021-01-29 16:33:47.980 | WARNING | expose.models.backbone.hrnet:load_weights:520 - data/network_weights/hrnet/imagenet/hrnet_w48-8ef0771d.pth does not exist!
2021-01-29 16:33:48.000 | INFO | expose.models.common.networks:__init__:267 - Building iterative regressor with 3 stages
2021-01-29 16:33:48.001 | INFO | expose.models.common.networks:__init__:282 - Detach mean: False
2021-01-29 16:33:48.134 | INFO | expose.models.backbone.resnet:resnet18:113 - Loading pretrained ResNet-18
2021-01-29 16:33:48.258 | INFO | expose.models.common.networks:__init__:267 - Building iterative regressor with 3 stages
2021-01-29 16:33:48.258 | INFO | expose.models.common.networks:__init__:282 - Detach mean: False
2021-01-29 16:33:48.260 | INFO | expose.models.attention.head_predictor:__init__:81 - Building head predictor with 3 stages
2021-01-29 16:33:48.398 | INFO | expose.models.backbone.resnet:resnet18:113 - Loading pretrained ResNet-18
2021-01-29 16:33:48.471 | INFO | expose.models.common.networks:__init__:267 - Building iterative regressor with 3 stages
2021-01-29 16:33:48.471 | INFO | expose.models.common.networks:__init__:282 - Detach mean: False
2021-01-29 16:33:48.472 | INFO | expose.models.attention.predictor:__init__:490 - 2D Head crop keyps loss: KeypointLoss(Norm type: L1)
2021-01-29 16:33:48.472 | INFO | expose.models.attention.predictor:__init__:502 - 2D Left hand crop keyps loss: KeypointLoss(Norm type: L1)
2021-01-29 16:33:48.473 | INFO | expose.models.attention.predictor:__init__:515 - 2D Left hand crop keyps loss: KeypointLoss(Norm type: L1)
2021-01-29 16:33:48.473 | INFO | expose.models.common.smplx_loss_modules:__init__:48 - Stages to penalize: [-1]
2021-01-29 16:33:48.473 | INFO | expose.models.common.smplx_loss_modules:__init__:400 - Stages to regularize: [-1]
2021-01-29 16:33:48.676 | INFO | expose.utils.checkpointer:__init__:44 - Creating directory data/checkpoints
2021-01-29 16:33:48.676 | INFO | expose.utils.checkpointer:load_checkpoint:90 - Load pretrained: False
2021-01-29 16:33:48.676 | WARNING | expose.utils.checkpointer:load_checkpoint:93 - Loading checkpoint from data/checkpoints/model.ckpt!
2021-01-29 16:33:49.287 | WARNING | expose.utils.checkpointer:load_checkpoint:121 - The following keys were not found: ['smplx.head_idxs', 'smplx.body_model.left_hand_components', 'smplx.body_model.right_hand_components', 'smplx.body_model.left_hand_mean', 'smplx.body_model.right_hand_mean', 'smplx.body_model.pose_mean', 'smplx.body_model.dynamic_lmk_bary_coords']
2021-01-29 16:33:49.287 | WARNING | expose.utils.checkpointer:load_checkpoint:124 - The following keys were not expected: ['smplx.body_model.source_idxs', 'smplx.body_model.target_idxs', 'smplx.body_model.extra_joint_regressor', 'smplx.body_model.dynamic_lmk_b_coords', 'smplx.hand_predictor.hand_offset', 'smplx.hand_predictor.hand_model.extra_joints_idxs', 'smplx.hand_predictor.hand_model.faces_tensor', 'smplx.hand_predictor.hand_model.v_template', 'smplx.hand_predictor.hand_model.shapedirs', 'smplx.hand_predictor.hand_model.J_regressor', 'smplx.hand_predictor.hand_model.posedirs', 'smplx.hand_predictor.hand_model.parents', 'smplx.hand_predictor.hand_model.lbs_weights', 'smplx.hand_predictor.pca_decoder.pca_basis', 'smplx.hand_predictor.pca_decoder.inv_pca_basis', 'smplx.hand_predictor.pca_decoder.mean', 'smplx.head_predictor.head_offset', 'smplx.head_predictor.head_vertices_ids', 'smplx.head_predictor.head_model.faces_tensor', 'smplx.head_predictor.head_model.v_template', 'smplx.head_predictor.head_model.shapedirs', 'smplx.head_predictor.head_model.expr_dirs', 'smplx.head_predictor.head_model.J_regressor', 'smplx.head_predictor.head_model.posedirs', 'smplx.head_predictor.head_model.parents', 'smplx.head_predictor.head_model.lbs_weights', 'smplx.head_predictor.head_model.lmk_faces_idx', 'smplx.head_predictor.head_model.lmk_bary_coords', 'smplx.head_predictor.head_model.dynamic_lmk_faces_idx', 'smplx.head_predictor.head_model.dynamic_lmk_b_coords', 'smplx.head_predictor.head_model.neck_kin_chain', 'smplx.body_loss.edge_loss.gt_connections', 'smplx.body_loss.edge_loss.est_connections', 'smplx.hand_loss.edge_loss.gt_connections', 'smplx.hand_loss.edge_loss.est_connections', 'smplx.head_loss.edge_loss.gt_connections', 'smplx.head_loss.edge_loss.est_connections']
libEGL warning: DRI2: failed to create dri screen
libEGL warning: Not allowed to force software rendering when API explicitly selects a hardware device.
libEGL warning: DRI2: failed to create dri screen
Traceback (most recent call last):
File "demo.py", line 554, in <module>
main(
File "/home/mona/venv/expose/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 26, in decorate_context
return func(*args, **kwargs)
File "demo.py", line 271, in main
hd_renderer = HDRenderer(img_size=body_crop_size)
File "/home/mona/research/code/expose/expose/utils/plot_utils.py", line 735, in __init__
super(HDRenderer, self).__init__(**kwargs)
File "/home/mona/research/code/expose/expose/utils/plot_utils.py", line 576, in __init__
super(OverlayRenderer, self).__init__(faces=faces, img_size=img_size)
File "/home/mona/research/code/expose/expose/utils/plot_utils.py", line 418, in __init__
self.renderer = pyrender.OffscreenRenderer(
File "/home/mona/venv/expose/lib/python3.8/site-packages/pyrender/offscreen.py", line 31, in __init__
self._create()
File "/home/mona/venv/expose/lib/python3.8/site-packages/pyrender/offscreen.py", line 149, in _create
self._platform.init_context()
File "/home/mona/venv/expose/lib/python3.8/site-packages/pyrender/platforms/egl.py", line 177, in init_context
assert eglInitialize(self._egl_display, major, minor)
File "/home/mona/venv/expose/lib/python3.8/site-packages/OpenGL/platform/baseplatform.py", line 402, in __call__
return self( *args, **named )
File "/home/mona/venv/expose/lib/python3.8/site-packages/OpenGL/error.py", line 228, in glCheckError
raise GLError(
OpenGL.error.GLError: GLError(
err = 12289,
baseOperation = eglInitialize,
cArguments = (
<OpenGL._opaque.EGLDisplay_pointer object at 0x7f7565840040>,
c_long(0),
c_long(0),
result = 0
Also, check https://stackoverflow.com/questions/65962222/solving-opengl-error-glerror-glerror-err-12289-opengl-opaque-egldisplay for more details
changed the title
OpenGL.error.GLError: GLError( err = 12289, baseOperation = eglInitialize, cArguments = ( <OpenGL._opaque.EGLDisplay_pointer object at 0x7f7565840040>, c_long(0), c_long(0), ), result = 0 )
OpenGL.error.GLError: GLError( err = 12289, baseOperation = eglInitialize, cArguments = ( <OpenGL._opaque.EGLDisplay_pointer object at 0x7f7565840040>, c_long(0), c_long(0), ), result = 0 ) libEGL warning: DRI2: failed to create dri screen libEGL warning: Not allowed to force software rendering when API explicitly selects a hardware device.
Jan 29, 2021
Thanks a lot @vchoutas for your help :)
solved the problem by changing
os.environ['PYOPENGL_PLATFORM'] = 'egl'
in demo.py and inference.py to:
os.environ['PYOPENGL_PLATFORM'] = 'osmesa'
and also:
$ cd ..
$ git clone git@github.com:mmatl/pyopengl.git
$ pip install ./pyopengl
os.environ['PYOPENGL_PLATFORM'] = 'osmesa'
I try it,but there is a new problem. Could you help me?
('Unable to load OpenGL library', 'libgcrypt.so.11: cannot open shared object file: No such file or directory', '/home/chen/APP/anaconda3/envs/py38/lib/libOSMesa.so.8', '/home/chen/APP/anaconda3/envs/py38/lib/libOSMesa.so.8')