denisecailab / minian

miniscope analysis pipeline with interactive visualizations
GNU General Public License v3.0
91 stars 35 forks source link

error in seed.init #51

Closed ghost closed 4 years ago

ghost commented 4 years ago

%%time seeds = seeds_init(Y, **param_seeds_init)

constructing chunks


TypeError Traceback (most recent call last) ~\Anaconda3\envs\minian\lib\site-packages\numpy\core\function_base.py in linspace(start, stop, num, endpoint, retstep, dtype, axis) 116 try: --> 117 num = operator.index(num) 118 except TypeError:

TypeError: 'numpy.float64' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

TypeError Traceback (most recent call last)

in ~\Documents\GitHub\minian\minian\initialization.py in seeds_init(varr, wnd_size, method, stp_size, nchunk, max_wnd, diff_thres) 30 if method == 'rolling': 31 nstp = np.ceil(nfm / stp_size) + 1 ---> 32 centers = np.linspace(0, nfm - 1, nstp) 33 hwnd = np.ceil(wnd_size / 2) 34 max_idx = list( <__array_function__ internals> in linspace(*args, **kwargs) ~\Anaconda3\envs\minian\lib\site-packages\numpy\core\function_base.py in linspace(start, stop, num, endpoint, retstep, dtype, axis) 117 num = operator.index(num) 118 except TypeError: --> 119 raise TypeError( 120 "object of type {} cannot be safely interpreted as an integer." 121 .format(type(num))) TypeError: object of type cannot be safely interpreted as an integer. my numpy version is 1.18 i found somewhere that downgrading it to 1.11 would fix the problem. I used the conda env file fixed for correct xarray/dask versions thank you! richardson
ghost commented 4 years ago

i just had to cast to int nstep: 31: nstp = int(np.ceil(nfm / stp_size) + 1)

in the initialization.py file