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

Issues with mesmerize Execution: Missing Packages in Active Conda Environment #272

Closed Tepps-ps closed 7 months ago

Tepps-ps commented 8 months ago

After installing mesmerize and its dependencies in a Conda environment, I encounter multiple warnings and a ModuleNotFoundError when attempting to launch mesmerize. Despite successful installation (verified through conda list), mesmerize reports that it cannot find caiman, tensorflow, tslearn, and h5py not being found. Any advice on further steps or potential solutions would be greatly appreciated.

Environment: OS: Windows 10 Conda version: 23.11.0 Python version: 3.10.13 Installed packages: caiman 1.10.2 tensorflow 2.10.0 tslearn 0.6.3 h5py 3.9.0

kushalkolar commented 8 months ago

What installation instructions did you follow?

Tepps-ps commented 8 months ago

I followed the installation instructions with the following steps:

conda install -c conda-forge mamba mamba create -n mescore -c conda-forge mesmerize-core mamba activate mescore caimanmanager install pip install "fastplotlib[notebook]"

kushalkolar commented 8 months ago

If you activate the environment and launch jupyterlab do the demo notebooks run?

kushalkolar commented 8 months ago

I notice you deleted a comment about the kernel dieing (we get notifications about everything, you don't have to be shy :P ). Either you have a GPU with insufficient RAM or you don't have a modern GPU.

Tepps-ps commented 8 months ago

Thank you for finding the comment! Updating the driver resolved the issue with the kernel crashing. However, when I executed the command 'df.iloc[0].caiman.run(),' I encountered an error stating, 'ValueError: need at most 63 handles, got a sequence of length 65.' The process has been running for over a dozen hours. I'm using Windows; doesn't this seem like an excessively long time?

kushalkolar commented 8 months ago

I need to see the full traceback

On Fri, Feb 16, 2024, 03:09 Tepps-ps @.***> wrote:

Thank you for finding the comment! Updating the driver resolved the issue with the kernel crashing. However, when I executed the command 'df.iloc[0].caiman.run(),' I encountered an error stating, 'ValueError: need at most 63 handles, got a sequence of length 65.' The process has been running for over a dozen hours. I'm using Windows; doesn't this seem like an excessively long time?

— Reply to this email directly, view it on GitHub https://github.com/nel-lab/mesmerize-core/issues/272#issuecomment-1947926957, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACHXXRA2UDK6B6HQFCIUJC3YT4HZ5AVCNFSM6AAAAABC7ILMYWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBXHEZDMOJVG4 . You are receiving this because you commented.Message ID: @.***>

Tepps-ps commented 8 months ago

sc 2024-02-17 113524 Here is the traceback. It has been more than 12 hours since running the command.

kushalkolar commented 8 months ago

it says motion correction finished successfully?

Tepps-ps commented 8 months ago

Yes, but still running..

kushalkolar commented 8 months ago

Send a keyboard interrupt

Tepps-ps commented 8 months ago

After keyboard interrupt, an error log about multiprocessing was displayed. sc 2024-02-17 135750 sc 2024-02-17 135832 sc 2024-02-17 135918 sc 2024-02-17 135952

kushalkolar commented 8 months ago

yea that happens when you do a keyboard interrupt, are you able to view the results? What are the dims of the input movie?

Tepps-ps commented 8 months ago

I'm unable to view any results. I used caimadata examples named 'data_endoscope'. It consists of 1000 frames, 128x128 pixels and a 16-bit depth.

kushalkolar commented 8 months ago

I'm unable to view any results.

Can you please elaborate, what did you do and what do you get?

Tepps-ps commented 7 months ago

Basically, the commands prepared in advance in the demo notebook 'cnmfe.ipynb' are executed in order from the top. While running the CaIman run command (df.iloc[0].caiman.run()) for motion correction on the first item in the DataFrame, the Jupyter Notebook remained in the "running" state for over 12 hours, even though the log output indicated that the process had finished successfully with the message mc finished successfully!. The DataFrame's first item (index 0) was configured with the following parameters:

In the output directory, files associated with the UUID d30a6e53-f727-4fee-97eb-c69b1ab8a027 were generated, which suggests that some level of processing was completed. However, a ValueError indicating that more than 63 handles were being waited on was encountered, which may be related to the hangup.

kushalkolar commented 7 months ago

Exactly what files are present in the uuid dir within the batch dir? How did you try to view the output? Please provide screenshots and as much information as you can. I unfortunately cannot help without all the details :)

Tepps-ps commented 7 months ago

Sorry for bothering you. Here is screenshot of files are present in the uuid dir. And I also shared the results of running the command df = df.caiman.reload_from_disk() in the Jupytert lab. I thought that if df.iloc[0].caiman.run() completed successfully, some value would be added in index[0]output is this correct? Screenshot 2024-02-20 141419 Screenshot 2024-02-20 141555 Screenshot 2024-02-20 141715

kushalkolar commented 7 months ago

From this it seems like multiprocessing on Windows doesn't work with more than 60 processes: https://github.com/scikit-learn/scikit-learn/issues/13354

You can limit the number of processes spawned to less than 60, see this: https://github.com/nel-lab/mesmerize-core/issues/205#issuecomment-1574585472

Tepps-ps commented 7 months ago

Thank you for your prompt and courteous response (I apologize for the delayed reply). The issue was resolved by limiting the number of processes spawned to less than 60.