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
279 stars 138 forks source link

Error while trying to generate new project #194

Closed fon215 closed 2 years ago

fon215 commented 2 years ago

Describe the bug I just had another error with outlier correction that I was attempting to fix by creating a new project. However, when I was doing this, adding my own pose configuration image and number of body parts, I followed the steps in the window and then once I added my image, entered the body part names, and clicked through the window of marking where each part was by double left clicking, the window went blank as shown in the screenshot below. This is the error message I received in the command window. Now I cannot generate a new project even when I close and reopen SimBA. Could someone help with this please?

Traceback (most recent call last): File "c:\tools\anaconda3\envs\simbaenv\lib\tkinter\__init__.py", line 1705, in __call__ return self.func(*args) File "c:\tools\anaconda3\envs\simbaenv\lib\site-packages\simba\SimBA.py", line 2963, in __init__ self.option_mice, optionsBasePhotosList = bodypartConfSchematic() File "c:\tools\anaconda3\envs\simbaenv\lib\site-packages\simba\drop_bp_cords.py", line 101, in bodypartConfSchematic optionsBaseNameList = pd.read_csv(optionsBaseListNamesPath, header=None) File "c:\tools\anaconda3\envs\simbaenv\lib\site-packages\pandas\io\parsers.py", line 685, in parser_f return _read(filepath_or_buffer, kwds) File "c:\tools\anaconda3\envs\simbaenv\lib\site-packages\pandas\io\parsers.py", line 463, in _read data = parser.read(nrows) File "c:\tools\anaconda3\envs\simbaenv\lib\site-packages\pandas\io\parsers.py", line 1154, in read ret = self._engine.read(nrows) File "c:\tools\anaconda3\envs\simbaenv\lib\site-packages\pandas\io\parsers.py", line 2059, in read data = self._reader.read(nrows) File "pandas/_libs/parsers.pyx", line 881, in pandas._libs.parsers.TextReader.read File "pandas/_libs/parsers.pyx", line 896, in pandas._libs.parsers.TextReader._read_low_memory File "pandas/_libs/parsers.pyx", line 950, in pandas._libs.parsers.TextReader._read_rows File "pandas/_libs/parsers.pyx", line 937, in pandas._libs.parsers.TextReader._tokenize_rows File "pandas/_libs/parsers.pyx", line 2132, in pandas._libs.parsers.raise_parser_error pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 14, saw 2

Screenshots

Screen Shot 2022-07-07 at 1 37 27 PM

itch mice body parts

This is the image I used for the configuration.

Desktop (Lenovo P340 Workstation (ThinkStation) - Type 30DH (Tower Form Factor)):

-OS build: 19043.1706 (Processor: Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz 3.70 GHz) -Python Version 3.10.4 -Are you using anaconda? - Yes

Additional context

I am working through a remote desktop while using this software.

sronilsson commented 2 years ago

hi @fon215! Interesting, just so I understand, the error happens when you click the button at the bottom of this img, Save Pose Config? image

fon215 commented 2 years ago

Yes, that is when the error happened. Now I cannot even get that window open because all of the tabs under Create new project when I click it are blank.

sronilsson commented 2 years ago

Which version of simba are you running? you can find out by typing pip show simba-uw-tf-dev

fon215 commented 2 years ago

This is the version listed: 0.91.9

Name: Simba-UW-tf-dev Version: 0.91.9 Summary: Toolkit for computer classification of complex social behaviors in experimental animals Home-page: https://github.com/sgoldenlab/simba Author: Simon Nilsson, Jia Jie Choong, Nastacia Goodwin, Sophia Hwang, Sam Golden Author-email: goldenneurolab@gmail.com License: GNU Lesser General Public License v3 (LGPLv3) Location: c:\tools\anaconda3\envs\simbaenv\lib\site-packages Requires: cefpython3, dash, dash-color-picker, dash-colorscales, dash-core-components, dash-html-components, dtreeviz, eli5, graphviz, h5py, imblearn, imgaug, imutils, matplotlib, numba, numexpr, numpy, opencv-python, pandas, Pillow, plotly, pyarrow, pyyaml, scikit-image, scikit-learn, scipy, seaborn, shap, shapely, statsmodels, tables, tabulate, tqdm, wxpython, xgboost, xlrd, yellowbrick Required-by:

sronilsson commented 2 years ago

Can you try (i) update simba with pip install simba-uw-tf-dev --upgrade. I'm not sure that will fixit though but worth a try before I dig as I can't recreate the error.

fon215 commented 2 years ago

Okay, so that worked temporarily and I got through the steps again but when I pressed Save pose configurations I got the same error again. After using the command you listed, these screenshots are showing the steps and screens I saw, ending with me having the blank screens again.

Screen Shot 2022-07-07 at 2 54 21 PM Screen Shot 2022-07-07 at 2 55 24 PM
sronilsson commented 2 years ago

OK, I think I might understand now, did you click the bodyparts in the image? Or did you draw the circles before importing the image into simba?

fon215 commented 2 years ago

Oh okay, I did not realize that, my mistake. I drew circles before importing the image into SimBA.

sronilsson commented 2 years ago

There are some instructions here: https://github.com/sgoldenlab/simba/blob/master/docs/Pose_config.md

sronilsson commented 2 years ago

here Is a gif I created for how to do it: https://github.com/sgoldenlab/simba/blob/master/images/New_pose_config.gif

fon215 commented 2 years ago

Sorry for all the questions, I just want to make sure I am doing this right! Now, I cannot get off of the blank tabs to properly follow the steps for the pose configurations. I am not sure if I will need to uninstall or something like that. Could you help me fix this somehow to get back to the working Create new project. I am getting that same error as before when I go to launch.

sronilsson commented 2 years ago

What happens if you restart SimBA? Do you still see blank tabs?

fon215 commented 2 years ago

When I close the application and reactivate the conda environment and then launch SimBa, I go to click on File then Create a new project and the blank tabs appear. I am not sure if this is what you meant. I also just noticed that is appears in the command prompt after the other error I showed you when I follow these steps.

can't invoke "event" command: application has been destroyed while executing "event generate $w <<ThemeChanged>>" (procedure "ttk::ThemeChanged" line 6) invoked from within "ttk::ThemeChanged"

sronilsson commented 2 years ago

This one is new! Can you try to uninstall simba with pip uninstall simba-uw-tf-dev, reinstall simba with pip install simba-uw-tf-dev, recreate your body-part configuration, and see if you encounter the same error?

fon215 commented 2 years ago

Okay, that seemed to get me past the error and I successfully generated the project and pose configurations. Thank you so much for your help!