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
290 stars 141 forks source link

Outlier correction error #174

Closed Urimons closed 2 years ago

Urimons commented 2 years ago

Describe the bug A clear and concise description of what the bug is. Hello, I am new to SimBA and I am trying to classify grooming behavior of one mouse, after doing pose-estimation via DLC. When I'm in the "outlier correction" tab and press the "run outlier correction", I get the following massage (in italic): _"Outlier correction settings updated in project_config.ini Pose-estimation body part setting for outlier correction: userdefined Applying settings for classical tracking... Processing 1 files for movement outliers..." and that's how it stays... also I get an error in the command window: _" File "C:\Users\YizharAnalysis\anaconda3\envs\simba\lib\site-packages\pandas\io\parsers.py", line 2059, in read data = self._reader.read(nrows) File "pandas/_libs/parsers.pyx", line 884, in pandas._libs.parsers.TextReader.read File "pandas/_libs/parsers.pyx", line 965, in pandas._libs.parsers.TextReader._read_rows File "pandas/_libs/parsers.pyx", line 2132, in pandas._libs.parsers.raise_parsererror pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 14, saw 4" I read a similar problem that was posted here, and also tried to press "skip outlier correction (CAUTION)" but got the same error.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'load video --> outlier corrections (after setting video parameters)'
  2. Click on 'run outlier correction'
  3. Scroll down to '....'
  4. See error: "pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 14, saw 4"

Expected behavior I am not sure (first time using SimBA), but I would expect to get some error estimation and correction?

Screenshots image

image

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

sgoldenlab commented 2 years ago

Hello @Urimons ! The error comes when SimBA trying to open the file in the project_folder/csv/input_csv folder. SimBA tries to read the file and assumes the file is in CSV format, when it is not a CSV file. I typically get this error when trying to read a CSV file, when it is in fact a PARQUET file, or vice versa. If you look inside the project_folder/csv/input_csv folder, what files do you see?

Urimons commented 2 years ago

image image

sgoldenlab commented 2 years ago

Hi @Urimons - it appears that the input_csv folder contains a CSV file that SimBA created from a file called config.yaml. Both these files are 3kb size, so very small, and unlikely to contain any pose-estimation tracking data. It is most likely a settings file from a pose-estimation project.

When you imported the tracking data to SimBA, did you point SimBA to a file (e.g., H5 or CSV) or folder (containing H5 or CSV files) with pose-estimation data? These files are usually larger, with one row for every frame in your video, and at least two columns (x, y coordinates) for every body-part that was tracked.

Urimons commented 2 years ago

You are right! When importing the correct file it worked Thanks :)