bop_toolkit
bop_toolkit copied to clipboard
ImportError: ('Unable to load EGL library', 22, 'The specified module could not be found', None, 126, None, 'EGL', None)
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.
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.
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 renderer_vispy.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'