thodan / bop_toolkit

A Python toolkit of the BOP benchmark for 6D object pose estimation.
http://bop.felk.cvut.cz
MIT License
376 stars 135 forks source link

ImportError: ('Unable to load EGL library', 22, 'The specified module could not be found', None, 126, None, 'EGL', None) #68

Open madhumilan opened 2 years ago

madhumilan commented 2 years ago

I am trying to use scripts/calc_gt_masks.py to generate GT masks for BOP dataset generation from here. I have tested this on Linux machine and it works fine, but now I have to use it on Windows and when I try to do it, I get the above error. I am not able to resolve it as the solutions provided were not w.r.t. bop_toolkit. I am using vispy for rendering as expected. Could you please tell me what I am missing?

Thanks.

wangg12 commented 2 years ago

Hi @madhumilan, I'm not sure whether the vispy renderer can work properly on Windows. Maybe you can try to change the egl backend https://github.com/thodan/bop_toolkit/blob/master/bop_toolkit_lib/renderer_vispy.py#L8 to other backends. Or you might need to consult the vispy developers https://github.com/vispy/vispy for further help.

pureYioYi commented 1 year ago

Hello, @madhumilan, I meet the the same error on Winodws. And I changed the backend "egl" to "pyglet", as suggested by @wangg12, which works fine for me. I install pyglet == 1.5.15 with python 3.7, because pyglet 2.0.0 requires Python 3.8 or newer.

Here is my code in _renderervispy.py:

os.environ["PYOPENGL_PLATFORM"] = "pyglet"
import numpy as np
import vispy
from vispy import app, gloo
import OpenGL.GL as gl

from bop_toolkit_lib import inout
from bop_toolkit_lib import misc
from bop_toolkit_lib import renderer

app_backend = "pyglet"
gl_backend = "gl2"  # "pyopengl2"  # speed: 'gl+' < 'gl2' < 'pyopengl2'