sgoldenlab / simba

SimBA (Simple Behavioral Analysis), a pipeline and GUI for developing supervised behavioral classifiers
https://simba-uw-tf-dev.readthedocs.io/
GNU General Public License v3.0
272 stars 137 forks source link

error when in creating animal direction to body part videos #334

Open Monica9577 opened 4 months ago

Monica9577 commented 4 months ago

Describe the bug when trying to create the video an error appears the next error

SIMBA INVALID FILE TYPE ERROR: C:\Users\monip\Desktop\TRIAL DEFINITIVO\project_folder\logs\body_part_directionality_dataframes\RI male M47-V_LEFT.csv is not a valid CSV file

To Reproduce Steps to reproduce the behavior:

  1. Load project
  2. Set video parameters
  3. outlier correction
  4. extract features
  5. In ROI windows - analyze distances; analyze directionality between animals, analyze directionality between body parts; Aggregate boolean conditional statics
  6. In ROI windows - Visualize directionality between body parts; choose body parts and run

Expected behavior A video with lines connecting the 2 selected body parts of the 2 animals

Desktop (please complete the following information):

Additional context I already have updated the simba software to the last version (1.86.1)

sronilsson commented 4 months ago

Hey @Monica9577! Do you have a full traceback screengrab of the error message?

Monica9577 commented 4 months ago

Yes, I'm pasting you the code

(NEW_SIMBA) C:\Users\monip>simba Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\monip\anaconda3\envs\NEW_SIMBA\lib\site-packages\simba\utils\read_write.py", line 131, in read_df df = df.astype(np.float32) File "C:\Users\monip\anaconda3\envs\NEW_SIMBA\lib\site-packages\pandas\core\generic.py", line 5882, in astype dtype=dtype, copy=copy, errors=errors, kwargs File "C:\Users\monip\anaconda3\envs\NEW_SIMBA\lib\site-packages\pandas\core\internals\managers.py", line 581, in astype return self.apply("astype", dtype=dtype, kwargs) File "C:\Users\monip\anaconda3\envs\NEW_SIMBA\lib\site-packages\pandas\core\internals\managers.py", line 438, in apply applied = getattr(b, f)(kwargs) File "C:\Users\monip\anaconda3\envs\NEW_SIMBA\lib\site-packages\pandas\core\internals\blocks.py", line 559, in astype return self._astype(dtype, copy=copy, errors=errors, values=values, kwargs) File "C:\Users\monip\anaconda3\envs\NEW_SIMBA\lib\site-packages\pandas\core\internals\blocks.py", line 643, in _astype values = astype_nansafe(vals1d, dtype, copy=True, **kwargs) File "C:\Users\monip\anaconda3\envs\NEW_SIMBA\lib\site-packages\pandas\core\dtypes\cast.py", line 729, in astype_nansafe return arr.astype(dtype, copy=True) ValueError: could not convert string to float: 'RI female M22-V_RIGHT'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\monip\anaconda3\envs\NEW_SIMBA\lib\tkinter__init.py", line 1705, in call return self.func(*args) File "C:\Users\monip\anaconda3\envs\NEW_SIMBA\lib\site-packages\simba\ui\pop_ups\directing_animal_to_bodypart_plot_pop_up.py", line 99, in command=lambda: self.create_directionality_plots(multiple_videos=False), File "C:\Users\monip\anaconda3\envs\NEW_SIMBA\lib\site-packages\simba\ui\pop_ups\directing_animal_to_bodypart_plot_pop_up.py", line 162, in __create_directionality_plots style_attr=style_attr, File "C:\Users\monip\anaconda3\envs\NEW_SIMBA\lib\site-packages\simba\plotting\directing_animals_to_bodypart_visualizer.py", line 62, in init self.data_dict = self.direction_analyzer.read_directionality_dfs() File "C:\Users\monip\anaconda3\envs\NEW_SIMBA\lib\site-packages\simba\data_processors\directing_animal_to_bodypart.py", line 169, in read_directionality_dfs results[file_name] = read_df(file_path, self.file_type) File "C:\Users\monip\anaconda3\envs\NEW_SIMBA\lib\site-packages\simba\utils\read_write.py", line 136, in read_df msg=f"{file_path} is not a valid CSV file", source=read_df.name simba.utils.errors.InvalidFileTypeError: SIMBA INVALID FILE TYPE ERROR: C:\Users\monip\Desktop\TRIAL DEFINITIVO\project_folder\logs\body_part_directionality_dataframes\RI female M22-V_RIGHT.csv is not a valid CSV file

Monica9577 commented 4 months ago

hello again

I have updated to the last version and it seems that it doesn't show this error anymore, eventhough in the result video I can't see the expected funnels. But I truly believe it's a problem in the annotations, I'll try to corrected and i'll tell you if the error it's solved