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

Erro: Fatal Python error: PyEval_RestoreThread: NULL tstate #244

Open anacastropsico opened 1 year ago

anacastropsico commented 1 year ago

When I go draw RO, this erro is show: Current thread 0x00002c0c (most recent call first): File "C:\Users\anaca\anaconda3\envs\SIMBA\lib\site-packages\simba\roi_tools\ROI_image.py", line 147 in draw_circle File "C:\Users\anaca\anaconda3\envs\SIMBA\lib\site-packages\simba\roi_tools\ROI_image.py", line 197 in initiate_draw File "C:\Users\anaca\anaconda3\envs\SIMBA\lib\site-packages\simba\roi_tools\ROI_define.py", line 595 in create_draw File "C:\Users\anaca\anaconda3\envs\SIMBA\lib\site-packages\simba\roi_tools\ROI_define.py", line 347 in File "C:\Users\anaca\anaconda3\envs\SIMBA\lib\tkinter__init.py", line 1705 in call File "C:\Users\anaca\anaconda3\envs\SIMBA\lib\tkinter\init.py", line 560 in mainloop File "C:\Users\anaca\anaconda3\envs\SIMBA\lib\site-packages\simba\roi_tools\ROI_define.py", line 132 in init File "C:\Users\anaca\anaconda3\envs\SIMBA\lib\site-packages\simba\roi_tools\ROI_menus.py", line 63 in draw File "C:\Users\anaca\anaconda3\envs\SIMBA\lib\tkinter\init.py", line 1705 in call File "C:\Users\anaca\anaconda3\envs\SIMBA\lib\tkinter\init.py", line 1283 in mainloop File "C:\Users\anaca\anaconda3\envs\SIMBA\lib\site-packages\simba\SimBA.py", line 3636 in main File "C:\Users\anaca\anaconda3\envs\SIMBA\Scripts\simba.exe\main__.py", line 7 in File "C:\Users\anaca\anaconda3\envs\SIMBA\lib\runpy.py", line 85 in _run_code File "C:\Users\anaca\anaconda3\envs\SIMBA\lib\runpy.py", line 193 in _run_module_as_main (SIMBA) PS C:\WINDOWS\system32>

sronilsson commented 1 year ago

Thanks for letting me know @anacastropsico! To troubleshoot, (i) which version of SimBA are you running (type pip show simba-uw-tf-dev)? (ii) which version of python are you running? (type python --version), make sure it is 64bit.

anacastropsico commented 1 year ago

Name: Simba-UW-tf-dev Version: 1.22.5 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, Sophia Hwang Author-email: sronilsson@gmail.com License: GNU Lesser General Public License v3 (LGPLv3) Location: c:\users\anaca\anaconda3\envs\simba\lib\site-packages Requires: numba, graphviz, dash-color-picker, numexpr, dtreeviz, pyarrow, pyyaml, tqdm, matplotlib, dash-colorscales, xlrd, opencv-python, imutils, scipy, scikit-image, h5py, plotly, imblearn, trafaret, shapely, numpy, statsmodels, pandas, seaborn, dash-html-components, shap, Pillow, tables, dash-core-components, imgaug, eli5, tabulate, wxpython, xgboost, cefpython3, scikit-le

Python 3.6.13 :: Anaconda, Inc.

sronilsson commented 1 year ago

Thanks @anacastropsico - can you see if the error persist after upgrading to latest version with pip install simba-uw-tf-dev --upgrade?

lxspedeza commented 1 year ago

Hi! I get the same error message after I'm clicking any of the tools for drawing the ROI, then Simba freezes and shuts down.

(simba) C:\Users\mpc>pip show simba-uw-tf-dev Name: Simba-UW-tf-dev Version: 1.73.3 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, Sophia Hwang Author-email: sronilsson@gmail.com License: GNU Lesser General Public License v3 (LGPLv3) Location: c:\programdata\anaconda3\envs\simba\lib\site-packages Requires: tables, eli5, pandas, matplotlib, dash, xgboost, wxpython, dash-color-picker, scikit-image, xlrd, imutils, opencv-python, tqdm, scipy, dtreeviz, scikit-learn, trafaret, numba, pyyaml, statsmodels, tabulate, seaborn, cefpython3, imgaug, numexpr, pyarrow, shap, dash-colorscales, Pillow, imblearn, plotly, shapely, dash-core-components, h5py, numpy, yellowbrick, dash-html-components, graphviz Required-by:

(simba) C:\Users\mpc>python --version Python 3.6.13 :: Anaconda, Inc.

Could you help me with this? Thank you!

sronilsson commented 1 year ago

Hi @lxspedeza, thanks for reporting this! Does this error still happen if you make sure there are no other python processes running on your computer? I.e., do a computer restart or kill all other python processes in the task manager?

If that doesn't help, can you paste me the error msg you are seeing? The error reported above from previous user is a little old and the line numbers are not the line numbers in the current version.

lxspedeza commented 1 year ago

Thank you for the quick reply @sronilsson ! In the meantime I realized, I only get this error message because after drawing a ROI, I didn't press space or enter (or c), but other buttons on the ROI panel. I just noticed the message in the Anaconda Terminal:

Select a ROI and then press SPACE or ENTER button! Cancel the selection process by pressing c button!

Before, I didn't know what to press. So with that the issue is solved. If you're curious about the error message after pressing different things from space, enter or c, this is what I get:

Fatal Python error: PyEval_RestoreThread: NULL tstate

Current thread 0x000011b8 (most recent call first): File "C:\ProgramData\anaconda3\envs\simba\lib\site-packages\simba\roi_tools\ROI_image.py", line 165 in initiate_x_y_callback File "C:\ProgramData\anaconda3\envs\simba\lib\site-packages\simba\roi_tools\ROI_image.py", line 169 in draw_polygon File "C:\ProgramData\anaconda3\envs\simba\lib\site-packages\simba\roi_tools\ROI_image.py", line 200 in initiate_draw File "C:\ProgramData\anaconda3\envs\simba\lib\site-packages\simba\roi_tools\ROI_define.py", line 567 in create_draw File "C:\ProgramData\anaconda3\envs\simba\lib\site-packages\simba\roi_tools\ROI_define.py", line 320 in File "C:\ProgramData\anaconda3\envs\simba\lib\tkinter__init.py", line 1705 in call File "C:\ProgramData\anaconda3\envs\simba\lib\tkinter\init.py", line 1283 in mainloop File "C:\ProgramData\anaconda3\envs\simba\lib\site-packages\simba\roi_tools\ROI_define.py", line 105 in init File "C:\ProgramData\anaconda3\envs\simba\lib\site-packages\simba\roi_tools\ROI_menus.py", line 66 in draw File "C:\ProgramData\anaconda3\envs\simba\lib\tkinter\init.py", line 1705 in call File "C:\ProgramData\anaconda3\envs\simba\lib\tkinter\init.py", line 1283 in mainloop File "C:\ProgramData\anaconda3\envs\simba\lib\site-packages\simba\SimBA.py", line 962 in main File "C:\ProgramData\anaconda3\envs\simba\Scripts\simba.exe\main__.py", line 7 in File "C:\ProgramData\anaconda3\envs\simba\lib\runpy.py", line 85 in _run_code File "C:\ProgramData\anaconda3\envs\simba\lib\runpy.py", line 193 in _run_module_as_main

sronilsson commented 1 year ago

Got it thank you! I will insert a more interpretable error msg.

While I got you here... I have had some occasional issues on my Mac drawing circles, not sure why.. do you get any error with the circles on your PC?

lxspedeza commented 1 year ago

I'm on Win10, and drawing circles works perfectly for me. Please lmk if I can help, I really appreciate your work!

sronilsson commented 1 year ago

I'm on Win10, and drawing circles works perfectly for me. Please lmk if I can help, I really appreciate your work!

Thanks for letting me know!