相关文章推荐
发财的枕头  ·  Thingsboard 可视化 -- ...·  3 年前    · 
大力的镜子  ·  vite ...·  3 年前    · 
I am using DLC for the first time.
Here’s some set up info:
I installed it with the conda environment, on a windows 11 machine, with a nvidia quadro p400 gpu.

deeplabcut = 2.3.5
napari-deeplabcut = 0.2.0
Cuda compilation tools, release 10.1, V10.1.105
tensorflow = 2.10.0
PyQt5 = 5.15.7
PySide6 = 6.3.1
vispy = 0.12.2

I had to edit the .yaml as suggested here to make it work.

Now, about my issue:
I am using the GUI. I am trying to test it with some video I have of a mouse on a threadmill. The video is in .mp4 format, that i converted from .mj2 using ffmpeg. I successfully extracted frames from the video
When I move on to labelling, the napari GUI is displaying only black, empty images. I can’t toggle layer visibility, yet I can see from the thumbnail that the image is supposedly here.

Here’s the error report I get

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\app\backends\_qt.py", line 903, in paintGL
    self._vispy_canvas.events.draw(region=None)
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\util\event.py", line 453, in __call__
    self._invoke_callback(cb, event)
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\util\event.py", line 471, in _invoke_callback
    _handle_exception(self.ignore_callback_errors,
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\util\event.py", line 469, in _invoke_callback
    cb(event)
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\scene\canvas.py", line 218, in on_draw
    self._draw_scene()
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\scene\canvas.py", line 277, in _draw_scene
    self.draw_visual(self.scene)
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\scene\canvas.py", line 315, in draw_visual
    node.draw()
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\scene\visuals.py", line 103, in draw
    self._visual_superclass.draw(self)
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\visuals\visual.py", line 451, in draw
    self._program.draw(self._vshare.draw_mode,
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\visuals\shaders\program.py", line 102, in draw
    Program.draw(self, *args, **kwargs)
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\gloo\program.py", line 543, in draw
    canvas.context.flush_commands()
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\gloo\context.py", line 171, in flush_commands
    self.shared.parser.parse([('CURRENT', 0, fbo)])
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\gloo\glir.py", line 824, in parse
    self._parse(command)
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\gloo\glir.py", line 752, in _parse
    gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, args[0])
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\gloo\gl\_gl2.py", line 55, in glBindFramebuffer
    nativefunc = glBindFramebuffer._native = _get_gl_func("glBindFramebuffer", None, (ctypes.c_uint, ctypes.c_uint,))
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\gloo\gl\gl2.py", line 85, in _get_gl_func
    raise RuntimeError('Using %s with no OpenGL context.' % name)
RuntimeError: Using glBindFramebuffer with no OpenGL context.
WARNING: Error drawing visual <Image at 0x1655dabe160>
Traceback (most recent call last):
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\gloo\gl\_gl2.py", line 53, in glBindFramebuffer
    nativefunc = glBindFramebuffer._native
AttributeError: 'function' object has no attribute '_native'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\gloo\gl\gl2.py", line 70, in _get_gl_func
    func = getattr(_lib, name)
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\ctypes\__init__.py", line 386, in __getattr__
    func = self.__getitem__(name)
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\ctypes\__init__.py", line 391, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'glBindFramebuffer' not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\app\backends\_qt.py", line 903, in paintGL
    self._vispy_canvas.events.draw(region=None)
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\util\event.py", line 453, in __call__
    self._invoke_callback(cb, event)
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\util\event.py", line 471, in _invoke_callback
    _handle_exception(self.ignore_callback_errors,
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\util\event.py", line 469, in _invoke_callback
    cb(event)
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\scene\canvas.py", line 218, in on_draw
    self._draw_scene()
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\scene\canvas.py", line 277, in _draw_scene
    self.draw_visual(self.scene)
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\scene\canvas.py", line 315, in draw_visual
    node.draw()
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\scene\visuals.py", line 103, in draw
    self._visual_superclass.draw(self)
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\visuals\visual.py", line 451, in draw
    self._program.draw(self._vshare.draw_mode,
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\visuals\shaders\program.py", line 102, in draw
    Program.draw(self, *args, **kwargs)
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\gloo\program.py", line 543, in draw
    canvas.context.flush_commands()
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\gloo\context.py", line 171, in flush_commands
    self.shared.parser.parse([('CURRENT', 0, fbo)])
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\gloo\glir.py", line 824, in parse
    self._parse(command)
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\gloo\glir.py", line 752, in _parse
    gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, args[0])
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\gloo\gl\_gl2.py", line 55, in glBindFramebuffer
    nativefunc = glBindFramebuffer._native = _get_gl_func("glBindFramebuffer", None, (ctypes.c_uint, ctypes.c_uint,))
  File "C:\Users\jcspm\anaconda3\envs\DEEPLABCUT\lib\site-packages\vispy\gloo\gl\gl2.py", line 85, in _get_gl_func
    raise RuntimeError('Using %s with no OpenGL context.' % name)
RuntimeError: Using glBindFramebuffer with no OpenGL context.

There seems to be something wrong with vispy and opengl …
vispy does not see opengl

>>> import vispy
>>> print(vispy.sys_info())
WARNING: pyqt5 already imported, cannot switch to pyside6
Platform: Windows-10-10.0.22621-SP0
Python:   3.8.17 (default, Jul  5 2023, 20:35:33) [MSC v.1916 64 bit (AMD64)]
NumPy:    1.24.4
Backend:  PyQt5
pyqt4:    None
pyqt5:    ('PyQt5', '5.15.7', '5.15.2')
pyqt6:    None
pyside:   None
pyside2:  None
pyside6:  ('PySide6', '6.3.1', '6.3.1')
pyglet:   None
glfw:     None
sdl2:     None
wx:       None
egl:      None
osmesa:   None
tkinter:  None
jupyter_rfb: None
_test:    None
GL version:  ''
MAX_TEXTURE_SIZE: ()
Extensions: ''

Yet pip instal opengl results to this :

Requirement already satisfied: pyopengl in c:\users\jcspm\anaconda3\envs\deeplabcut\lib\site-packages (3.1.7)

I have tried a solution I found on this thread, but it did not work.
I am at a loss, and suffered already during the installation process :sweat_smile: so I would greatly appreciate any help.

Thank you
Julien

Hi Julien,

Have you tried the solution described in this thread?

It seems that PyQt5 is being used when it should be Pyside6.

Best,
Niels

I uninstalled pyside6 and it broke DLC

Loading DLC 2.3.5...
C:\Users\jcspm\anaconda3\envs\deeplabcut\lib\site-packages\qtpy\__init__.py:267: RuntimeWarning: Selected binding "pyside6" could not be found, using "pyqt5"
  warnings.warn('Selected binding "{}" could not be found, '
DLC loaded in light mode; you cannot use any GUI (labeling, relabeling and standalone GUI)
Starting GUI...
Traceback (most recent call last):
  File "C:\Users\jcspm\anaconda3\envs\deeplabcut\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\jcspm\anaconda3\envs\deeplabcut\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\jcspm\anaconda3\envs\deeplabcut\lib\site-packages\deeplabcut\__main__.py", line 22, in <module>
    from deeplabcut.gui.launch_script import launch_dlc
  File "C:\Users\jcspm\anaconda3\envs\deeplabcut\lib\site-packages\deeplabcut\gui\launch_script.py", line 25, in <module>
    import PySide6.QtWidgets as QtWidgets
ImportError: DLL load failed while importing QtWidgets: The specified module could not be found.

I installed qtwidgets on its own and it did not change anything

Thank you

Sorry I think I was misunderstood - it’s PyQT5 that should be uninstalled, as DeepLabCut requires PySide6 to be used.

You can run:

pip uninstall PyQt5
pip install pyside6<6.3.2
              

I tried that and got the exact same error

RuntimeError: Using glBindFramebuffer with no OpenGL context.

While vispy keeps not seeing opengl

>>> print(vispy.sys_info())
Platform: Windows-10-10.0.22621-SP0
Python:   3.8.17 (default, Jul  5 2023, 20:35:33) [MSC v.1916 64 bit (AMD64)]
NumPy:    1.24.4
Backend:  PySide6
pyqt4:    None
pyqt5:    None
pyqt6:    None
pyside:   None
pyside2:  None
pyside6:  ('PySide6', '6.3.1', '6.3.1')
pyglet:   None
glfw:     None
sdl2:     None
wx:       None
egl:      None
osmesa:   None
tkinter:  None
jupyter_rfb: None
_test:    None
GL version:  ''
MAX_TEXTURE_SIZE: ()
Extensions: ''