CaImAn
CaImAn copied to clipboard
refit() for CNMFE?
- Tell us a bit about your setup:
-
Operating system (Linux/macOS/Windows): Windows 10.
-
Python version (3.x): 3.6.11
-
Working environment (Python IDE/Jupyter Notebook/other): Jupyter
-
Which of the demo scripts you're using for your analysis (if applicable): demo_pipeline_cnmfE
-
CaImAn version*: 1.8.5
-
CaImAn installation process (
pip install .
/pip install -e .
/conda): conda
-
Describe the issue that you are experiencing In the cnmf-e demo, after running
cnm = cnm.fit(images)
(which works fine), I tried to runcnm2 = cnm.refit(images, dview=dview)
(I set dview to None before posting here), and got an error. Stack trace is copied below. -
Copy error log below
ValueError Traceback (most recent call last)
in 1 #%% RE-RUN seeded CNMF on accepted patches to refine 2 # Following does not work in cnmf-E pipeline get ValueError ----> 3 cnm2 = cnm.refit(images, dview=dview) ~\miniconda3\envs\caiman\lib\site-packages\caiman\source_extraction\cnmf\cnmf.py in refit(self, images, dview) 415 cnm.estimates = estimates 416 cnm.mmap_file = self.mmap_file --> 417 return cnm.fit(images) 418 419 def fit(self, images, indices=(slice(None), slice(None))):
~\miniconda3\envs\caiman\lib\site-packages\caiman\source_extraction\cnmf\cnmf.py in fit(self, images, indices) 541 542 logging.info('update spatial ...') --> 543 self.update_spatial(Yr, use_init=True) 544 545 logging.info('update temporal ...')
~\miniconda3\envs\caiman\lib\site-packages\caiman\source_extraction\cnmf\cnmf.py in update_spatial(self, Y, use_init, **kwargs) 934 update_spatial_components(Y, C=self.estimates.C, f=self.estimates.f, A_in=self.estimates.A, 935 b_in=self.estimates.b, dview=self.dview, --> 936 sn=self.estimates.sn, dims=self.dims, **self.params.get_group('spatial')) 937 938 return self
~\miniconda3\envs\caiman\lib\site-packages\caiman\source_extraction\cnmf\spatial.py in update_spatial_components(Y, C, f, A_in, sn, dims, min_size, max_size, dist, normalize_yyt_one, method_exp, expandCore, dview, n_pixels_per_process, medw, thr_method, maxthr, nrgthr, extract_cc, b_in, se, ss, nb, method_ls, update_background_components, low_rank_background, block_size_spat, num_blocks_per_run_spat) 216 # we create a memory map file if not already the case, we send Cf, a 217 # matrix that include background components --> 218 C_name, Y_name, folder = creatememmap(Y, np.vstack((C, f)), dview) 219 220 # we create a pixel group array (chunks for the cnmf)for the parrallelization of the process
<array_function internals> in vstack(*args, **kwargs)
~\miniconda3\envs\caiman\lib\site-packages\numpy\core\shape_base.py in vstack(tup) 281 if not isinstance(arrs, list): 282 arrs = [arrs] --> 283 return _nx.concatenate(arrs, 0) 284 285
<array_function internals> in concatenate(*args, **kwargs)
ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 1, the array at index 0 has size 1000 and the array at index 1 has size 1