KeyError: 'Are there multiple animals in your single-animal DLC video? Make sure to set the animal_ids parameter in deepof.data.Project'
Hi, I'm facing an issue with a multi-animals dlc output. This is my first approach to the program so maybe I'm doing something wrong. I'm working on jupyterlab and I've got this error message after the manual detection of a square arena, specifically after the computing distances and angles:
KeyError Traceback (most recent call last) File ~.conda\envs\deepof\lib\site-packages\deepof\data.py:555, in Project.get_angles(self, tab_dict, verbose) 552 for clique in bridges: 553 dat = pd.DataFrame( 554 deepof.utils.angle( --> 555 np.array(tab[clique]).reshape([3, tab.shape[0], 2]) 556 ).T 557 ) 559 dat.columns = [tuple(clique)]
File ~.conda\envs\deepof\lib\site-packages\pandas\core\frame.py:3813, in DataFrame.getitem(self, key) 3812 key = list(key) -> 3813 indexer = self.columns._get_indexer_strict(key, "columns")[1] 3815 # take() does not accept boolean indexers
File ~.conda\envs\deepof\lib\site-packages\pandas\core\indexes\multi.py:2623, in MultiIndex._get_indexer_strict(self, key, axis_name) 2621 indexer = self._get_indexer_level_0(keyarr) -> 2623 self._raise_if_missing(key, indexer, axis_name) 2624 return self[indexer], indexer
File ~.conda\envs\deepof\lib\site-packages\pandas\core\indexes\multi.py:2641, in MultiIndex._raise_if_missing(self, key, indexer, axis_name) 2640 if cmask.any(): -> 2641 raise KeyError(f"{keyarr[cmask]} not in index") 2642 # We get here when levels still contain values which are not 2643 # actually in Index anymore
KeyError: "['mouse1_Left_ear' 'mouse1_Nose' 'mouse1_Right_ear'] not in index"
During handling of the above exception, another exception occurred:
KeyError Traceback (most recent call last) Cell In[4], line 1 ----> 1 my_deepof_project = my_deepof_project.create(verbose=True)
File ~.conda\envs\deepof\lib\site-packages\deepof\data.py:670, in Project.create(self, verbose, force) 667 distances = self.get_distances(tables, verbose) 669 if self.angles: --> 670 angles = self.get_angles(tables, verbose) 672 if self.areas: 673 areas = self.get_areas(tables, verbose)
File ~.conda\envs\deepof\lib\site-packages\deepof\data.py:566, in Project.get_angles(self, tab_dict, verbose) 564 angle_dict[key] = dats 565 except KeyError: --> 566 raise KeyError( 567 "Are there multiple animals in your single-animal DLC video? Make sure to set the animal_ids parameter" 568 " in deepof.data.Project" 569 ) 571 # Restore original index 572 for key in angle_dict.keys():
KeyError: 'Are there multiple animals in your single-animal DLC video? Make sure to set the animal_ids parameter in deepof.data.Project'
However, I set the animals_ids respectively with 'mouse1' and 'mouse2' individuals, as I did on dlc. Thank you so much.
Best, Silvia