flatironinstitute/CaImAn-MATLAB

Error using parallel.FevalFuture/fetchNext

674067482 opened this issue · 1 comments

Hello, I ran the 'run_pipeline.m' on Linux. Our input is a 204820482998 hdf5 file. All parameters was default except 'fr' was set to be 2. The complete error log list below:

run_pipeline
Starting parallel pool (parpool) using the 'local' profile ...
connected to 12 workers.
Registering the first 200 frames just to obtain a good template......done.
Template initialization complete. Now registering all the frames with new template.
200 out of 2998 frames registered, iteration 1 out of 1.
400 out of 2998 frames registered, iteration 1 out of 1.
600 out of 2998 frames registered, iteration 1 out of 1.
800 out of 2998 frames registered, iteration 1 out of 1.
1000 out of 2998 frames registered, iteration 1 out of 1.
1200 out of 2998 frames registered, iteration 1 out of 1.
1400 out of 2998 frames registered, iteration 1 out of 1.
1600 out of 2998 frames registered, iteration 1 out of 1.
1800 out of 2998 frames registered, iteration 1 out of 1.
2000 out of 2998 frames registered, iteration 1 out of 1.
2200 out of 2998 frames registered, iteration 1 out of 1.
2400 out of 2998 frames registered, iteration 1 out of 1.
2600 out of 2998 frames registered, iteration 1 out of 1.
2800 out of 2998 frames registered, iteration 1 out of 1.
2998 out of 2998 frames registered, iteration 1 out of 1..No downsampling is performed
No downsampling is performed
Elapsed time is 1300.522506 seconds.
Error using parallel.FevalFuture/fetchNext (line 217)
The function evaluation completed with an error.
Error in run_CNMF_patches (line 121)
[idx, value] = fetchNext(future_results);
Error in run_pipeline (line 136)
[A,b,C,f,S,P,RESULTS,YrA] = run_CNMF_patches(data.Y,K,patches,tau,0,options); % do not perform deconvolution here since
Caused by:
Error using images.internal.morphop>ParseInputs (line 154)
Expected input number 1, IM, to be non-NaN.

Thanks for your help!

epnev commented

@674067482 It might be due to a memory issue as also suggested in #91.

Instead of passing the argument data.Y in the run_CNMF_patches function try passing just data:
[A,b,C,f,S,P,RESULTS,YrA] = run_CNMF_patches(data, K, patches, tau, 0, options);
This should use the memory mapped file and hopefully consume less memory. Spatially subsampling should also help.

Also, you have a large FOV, but slow imaging rate. If you're trying to analyze lightsheet imaging data you might want to try the python implementation of the CaImAn online algorithm. See for example Figure 6 in our paper for more details.