Seyij / norman

A package for automation of the novel object recognition behavioural assay in neuroscience studies. The Novel Object Recognition Mouse Analysis Network (NORMAN) system.
GNU Lesser General Public License v3.0
7 stars 1 forks source link

Error withs pandas functions ? #1

Open matthieufaillot opened 2 years ago

matthieufaillot commented 2 years ago

Hi, Thank you for making norman available. I am running norman in python 3.6 (Python 3.6.13 |Anaconda, Inc.| (default, Mar 16 2021, 11:37:27) [MSC v.1916 64 bit (AMD64)] on win32) in a conda environment. OS= Windows 11.

When pressing "Accept and run video analysis" in GUI, it prints the following error message. Seems to be related to pandas functions. Pandas version in the environment is 1.1.5.

` File "C:\Users\matth\anaconda3\envs\norman_dlc\lib\site-packages\norman_ai\norman_functions.py", line 272, in find_objects

most_overlaps = df_clean.loc[df_clean["overlaps_w"].str.len()==max(df_clean["overlaps_w"].str.len())]

File "C:\Users\matth\anaconda3\envs\norman_dlc\lib\site-packages\pandas\core\generic.py", line 5137, in getattr return object.getattribute(self, name) File "C:\Users\matth\anaconda3\envs\norman_dlc\lib\site-packages\pandas\core\accessor.py", line 187, in get accessor_obj = self._accessor(obj) File "C:\Users\matth\anaconda3\envs\norman_dlc\lib\site-packages\pandas\core\strings.py", line 2100, in init self._inferred_dtype = self._validate(data) File "C:\Users\matth\anaconda3\envs\norman_dlc\lib\site-packages\pandas\core\strings.py", line 2157, in _validate raise AttributeError("Can only use .str accessor with string values!") AttributeError: Can only use .str accessor with string values! C:\Users\matth\anaconda3\envs\norman_dlc\lib\site-packages\norman_ai\norman_functions.py:259: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy df_cut["overlaps_w"] = df["bound_rects"].apply(list_overlap) Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\matth\anaconda3\envs\norman_dlc\lib\tkinter__init.py", line 1705, in call return self.func(*args) File "C:\Users\matth\anaconda3\envs\norman_dlc\lib\site-packages\norman_ai\norman_functions.py", line 1074, in run_analysis norkid1 = norkid(video_path, pose_path, no_location, ml_path) File "C:\Users\matth\anaconda3\envs\norman_dlc\lib\site-packages\norman_ai\norman_functions.py", line 951, in init self.object_locs, self.fo_img = find_objects(self.median_img, img_out = True) File "C:\Users\matth\anaconda3\envs\norman_dlc\lib\site-packages\norman_ai\norman_functions.py", line 272, in find_objects most_overlaps = df_clean.loc[df_clean["overlaps_w"].str.len()==max(df_clean["overlaps_w"].str.len())] File "C:\Users\matth\anaconda3\envs\norman_dlc\lib\site-packages\pandas\core\generic.py", line 5137, in getattr return object.getattribute(self, name) File "C:\Users\matth\anaconda3\envs\norman_dlc\lib\site-packages\pandas\core\accessor.py", line 187, in get__ accessor_obj = self._accessor(obj) File "C:\Users\matth\anaconda3\envs\norman_dlc\lib\site-packages\pandas\core\strings.py", line 2100, in init self._inferred_dtype = self._validate(data) File "C:\Users\matth\anaconda3\envs\norman_dlc\lib\site-packages\pandas\core\strings.py", line 2157, in _validate raise AttributeError("Can only use .str accessor with string values!") AttributeError: Can only use .str accessor with string values!

Seyij commented 2 years ago

Hello, thanks for trying out NORMAN, I have not had this in active development for some time so there maybe some depency issues I need to check over. Due to some additional developments I will be taking the repository private for the time being, sorry for any inconvenience and thanks for giving NORMAN a try.