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

DeepLabCut import error #428

Closed
catubc opened this issue Dec 8, 2020 · 1 comment
Closed

DeepLabCut import error #428

catubc opened this issue Dec 8, 2020 · 1 comment

Comments

@catubc
Copy link

catubc commented Dec 8, 2020

Hello
I'm trying to import a DeepLabCut dataset and getting this error.

Any suggestions?



(sleap_env) cat@cat-work:~$ sleap-label
2020-12-08 05:11:29.122151: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libnvinfer.so.6
2020-12-08 05:11:29.123921: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libnvinfer_plugin.so.6
Traceback (most recent call last):
  File "/home/cat/anaconda3/envs/sleap_env/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2898, in get_loc
    return self._engine.get_loc(casted_key)
  File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1675, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1683, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'x'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "pandas/_libs/index.pyx", line 705, in pandas._libs.index.BaseMultiIndexCodesEngine.get_loc
  File "/home/cat/anaconda3/envs/sleap_env/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2900, in get_loc
    raise KeyError(key) from err
KeyError: 'x'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/cat/anaconda3/envs/sleap_env/lib/python3.6/site-packages/sleap/gui/commands.py", line 216, in importDLC
    self.execute(ImportDeepLabCut)
  File "/home/cat/anaconda3/envs/sleap_env/lib/python3.6/site-packages/sleap/gui/commands.py", line 184, in execute
    command().execute(context=self, params=kwargs)
  File "/home/cat/anaconda3/envs/sleap_env/lib/python3.6/site-packages/sleap/gui/commands.py", line 93, in execute
    self.do_with_signal(context, params)
  File "/home/cat/anaconda3/envs/sleap_env/lib/python3.6/site-packages/sleap/gui/commands.py", line 117, in do_with_signal
    cls.do_action(context, params)
  File "/home/cat/anaconda3/envs/sleap_env/lib/python3.6/site-packages/sleap/gui/commands.py", line 615, in do_action
    labels = Labels.load_deeplabcut(filename=params["filename"])
  File "/home/cat/anaconda3/envs/sleap_env/lib/python3.6/site-packages/sleap/io/dataset.py", line 1431, in load_deeplabcut
    return read(filename, for_object="labels", as_format="deeplabcut")
  File "/home/cat/anaconda3/envs/sleap_env/lib/python3.6/site-packages/sleap/io/format/__init__.py", line 58, in read
    return disp.read(filename, *args, **kwargs)
  File "/home/cat/anaconda3/envs/sleap_env/lib/python3.6/site-packages/sleap/io/format/dispatch.py", line 49, in read
    return adaptor.read(file, *args, **kwargs)
  File "/home/cat/anaconda3/envs/sleap_env/lib/python3.6/site-packages/sleap/io/format/deeplabcut.py", line 229, in read
    FileHandle(csv_path), full_video=video, skeleton=skeleton
  File "/home/cat/anaconda3/envs/sleap_env/lib/python3.6/site-packages/sleap/io/format/deeplabcut.py", line 116, in read_frames
    x, y = data[(node, "x")][i], data[(node, "y")][i]
  File "/home/cat/anaconda3/envs/sleap_env/lib/python3.6/site-packages/pandas/core/frame.py", line 2905, in __getitem__
    return self._getitem_multilevel(key)
  File "/home/cat/anaconda3/envs/sleap_env/lib/python3.6/site-packages/pandas/core/frame.py", line 2955, in _getitem_multilevel
    loc = self.columns.get_loc(key)
  File "/home/cat/anaconda3/envs/sleap_env/lib/python3.6/site-packages/pandas/core/indexes/multi.py", line 2714, in get_loc
    return self._engine.get_loc(key)
  File "pandas/_libs/index.pyx", line 708, in pandas._libs.index.BaseMultiIndexCodesEngine.get_loc
KeyError: ('adult_female', 'x')

@talmo
Copy link
Collaborator

talmo commented Dec 8, 2020

Hi @catubc,

Yes, we've added support for the new DLC labels format in the next version of SLEAP, but you can install the pre-release now to try it out: https://github.com/murthylab/sleap/releases/tag/v1.0.10a9

Feel free to re-open if you still can't import with the new version.

Cheers!

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