Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Napari Problems #146

Open
kayjuen opened this issue Nov 28, 2024 · 2 comments
Open

Napari Problems #146

kayjuen opened this issue Nov 28, 2024 · 2 comments

Comments

@kayjuen
Copy link

kayjuen commented Nov 28, 2024

Hi,
I am working with deeplabcut 3.0.5rc on windows 11.
When I try to "save selected layers" after annotation in npari (gui), I receive the following:
(dlc_test) C:\Windows\System32>python -m deeplabcut
Loading DLC 3.0.0rc5...
Starting GUI...
QPixmap::scaled: Pixmap is a null pixmap
WARNING: DirectWrite: CreateFontFaceFromHDC() failed (Gibt einen Fehler in einer Eingabedatei an, zum Beispiel eine Schriftartdatei.) for QFontDef(Family="MS Sans Serif", pointsize=12, pixelsize=16, styleHint=5, weight=400, stretch=100, hintingPreference=0) LOGFONT("MS Sans Serif", lfWidth=0, lfHeight=-16) dpi=96
WARNING:vispy:DirectWrite: CreateFontFaceFromHDC() failed (Gibt einen Fehler in einer Eingabedatei an, zum Beispiel eine Schriftartdatei.) for QFontDef(Family="MS Sans Serif", pointsize=12, pixelsize=16, styleHint=5, weight=400, stretch=100, hintingPreference=0) LOGFONT("MS Sans Serif", lfWidth=0, lfHeight=-16) dpi=96
Traceback (most recent call last):
File "C:\ProgramData\anaconda3\envs\dlc_test\lib\site-packages\napari_deeplabcut_widgets.py", line 656, in
lambda: _save_layers_dialog(
File "C:\ProgramData\anaconda3\envs\dlc_test\lib\site-packages\napari_deeplabcut_widgets.py", line 300, in _save_layers_dialog
self.viewer.layers.save("", selected=True, plugin="napari-deeplabcut")
File "C:\ProgramData\anaconda3\envs\dlc_test\lib\site-packages\napari\utils_proxies.py", line 188, in call
return self.create(self.wrapped(*args, **kwargs))
File "C:\ProgramData\anaconda3\envs\dlc_test\lib\site-packages\napari\components\layerlist.py", line 476, in save
return save_layers(path, layers, plugin=plugin, _writer=_writer)
File "C:\ProgramData\anaconda3\envs\dlc_test\lib\site-packages\napari\plugins\io.py", line 229, in save_layers
_written, writer_name = _write_single_layer_with_plugins(
File "C:\ProgramData\anaconda3\envs\dlc_test\lib\site-packages\napari\plugins\io.py", line 460, in _write_single_layer_with_plugins
raise ValueError(
ValueError: There is no registered plugin named 'napari-deeplabcut'.
Plugins capable of writing layer._type_string layers are: set()

Conda list yields the following installations:
napari 0.4.18 pypi_0 pypi
napari-console 0.1.0 pypi_0 pypi
napari-deeplabcut 0.2.1.7 pypi_0 pypi
napari-plugin-engine 0.2.0 pypi_0 pypi
napari-svg 0.2.0 pypi_0 pypi

I simply dont know what to do, since the functions worked fine until a couple of days ago. SInce then I am not able to save annotations. In the respective folder I see a "collecteddata_k.h5" file, but no .csv as it used to be. Moreover, I cant build a skeleton in deeplabcut gui because of missing or non readable .h5 files.
Has anyone a clue what went wrong on my system?

Best
Kay

@kayjuen kayjuen changed the title Npari Problems Napari Problems Nov 28, 2024
@alexander-vass
Copy link

bump. I have the same exact error and it's killing me. The versions all seem to check out with whats listed on (https://www.napari-hub.org/plugins/napari-deeplabcut) but I cannot for the life of me get the plugin to be recognized.

in ipython:
import napari from napari.plugins import plugin_manager plugin_manager.discover() print(plugin_manager.plugins)

returns an empty dict. But weirder still, in the napari viewer, whether opened through napari.Viewer() or through deeplabcut via the label_frames call, I can see the keypoint in the plugins dropdown + in the install/uininstall plugins window with the correct version (0.2.1.7).

Additionally, if I try:

import napari_deeplabcut print(napari_deeplabcut.__file__)

I get "C:\Users\DLC_analysis\src\napari-deeplabcut_init_.py" so, the file appears to be there? Not sure why it can't get registered. Attempting to manually register via: plugin_manager.register(napari_deeplabcut, name="napari-deeplabcut")
results in the following error: RuntimeError: Refusing to import PyQT5 because PySide6.QtCore is already imported

This is a very bothersome issue and I'm out of ideas after banging my head against a wall for the last few hours, any help would be massively appreciated

@alexander-vass
Copy link

oh my god I fixed it with the help of a comment I found in a different issue thread, the issue is so dumb I swear

DeepLabCut/DeepLabCut#2627

this comment by lomedi solved it for me:

"I somehow got the napari plugin to work through rewriting the body parts in the current config file manually, instead of copying and pasting the list of body parts from other config files I used. It seemed that this resolved the error in two separate instances on different computers, so I would recommend trying it to anyone experiencing the same error. I apologize for the delayed update here, and thank you for your support!"

I hope it works for you too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants