nel-lab / mesmerize-core

High level pandas-based API for batch analysis of Calcium Imaging data using CaImAn
Other
60 stars 15 forks source link

ValueError: need at most 63 handles, got a sequence of length 65 #205

Closed Forest-Speed closed 1 year ago

Forest-Speed commented 1 year ago

Hey,

I get this error when I run Mesmerize (or Caiman) on a computer with 32 cores (threadripper 5975). I have been able to bypass this issue, (when using the VolPy demo pipeline), by changing the n_processes variable to 50. However, there does not seem to be a way to do this with the mesmerize demos. Below is my output for the CNMFe demo in mesemerize. Any thoughts?

Exception in thread Thread-10 (_handle_workers): Traceback (most recent call last): File "c:\Users\Researcher\anaconda3\envs\cloned_mescore\lib\threading.py", line 1016, in _bootstrap_inner self.run() File "c:\Users\Researcher\anaconda3\envs\cloned_mescore\lib\threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "c:\Users\Researcher\anaconda3\envs\cloned_mescore\lib\multiprocessing\pool.py", line 522, in _handle_workers cls._wait_for_updates(current_sentinels, change_notifier) File "c:\Users\Researcher\anaconda3\envs\cloned_mescore\lib\multiprocessing\pool.py", line 502, in _wait_for_updates wait(sentinels, timeout=timeout) File "c:\Users\Researcher\anaconda3\envs\cloned_mescore\lib\multiprocessing\connection.py", line 884, in wait ready_handles = _exhaustive_wait(waithandle_to_obj.keys(), timeout) File "c:\Users\Researcher\anaconda3\envs\cloned_mescore\lib\multiprocessing\connection.py", line 816, in _exhaustive_wait res = _winapi.WaitForMultipleObjects(L, False, timeout)

kushalkolar commented 1 year ago

You can reduce number of processes to spawn using the MESMERIZE_N_PROCESSES environment variable.

For setting env vars from Python see: https://stackoverflow.com/a/5971326

Forest-Speed commented 1 year ago

Awesome, thank you Kushal!