nel-lab / mesmerize-core

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

ValueError: all the input array dimensions except for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 140 and the array at index 1 has size 141 #253

Closed qweasdf1354 closed 7 months ago

qweasdf1354 commented 10 months ago

Hi, author! after run the mcorr and cnmf, I use the following code but occur some unexpected. is that something i set wrong? I use windows10 system. and I update the viz by git. and restart the kernel but not help. Could you help me?

iw_rcm = fpl.ImageWidget(
    data=[input_movie, rcm, rcb, residuals], 
    grid_plot_kwargs={"size": (800, 600)}, 
    cmap="gnuplot2"
)
iw_rcm.show()

and

viz_cnmf = df.cnmf.viz()
viz_cnmf.show()

It occur error

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[34], line 1
----> 1 iw_rcm = fpl.ImageWidget(
      2     data=[input_movie, rcm, rcb, residuals], 
      3     grid_plot_kwargs={"size": (800, 600)}, 
      4     cmap="gnuplot2"
      5 )
      6 iw_rcm.show()

File ~\miniforge3\envs\mescore\lib\site-packages\fastplotlib\widgets\image.py:564, in ImageWidget.__init__(self, data, dims_order, slider_dims, window_funcs, frame_apply, grid_shape, names, grid_plot_kwargs, histogram_widget, **kwargs)
    561 subplot.set_title(name)
    563 if histogram_widget:
--> 564     hlut = HistogramLUT(
    565         data=d,
    566         image_graphic=ig,
    567         name="histogram_lut"
    568     )
    570     subplot.docks["right"].add_graphic(hlut)
    571     subplot.docks["right"].size = 80

File ~\miniforge3\envs\mescore\lib\site-packages\fastplotlib\widgets\histogram_lut.py:46, in HistogramLUT.__init__(self, data, image_graphic, nbins, flank_divisor, **kwargs)
     42 self._scale_factor: float = 1.0
     44 hist, edges, hist_scaled, edges_flanked = self._calculate_histogram(data)
---> 46 line_data = np.column_stack([hist_scaled, edges_flanked])
     48 self.line = LineGraphic(line_data)
     50 bounds = (edges[0], edges[-1])

File ~\miniforge3\envs\mescore\lib\site-packages\numpy\lib\shape_base.py:652, in column_stack(tup)
    650         arr = array(arr, copy=False, subok=True, ndmin=2).T
    651     arrays.append(arr)
--> 652 return _nx.concatenate(arrays, 1)

ValueError: all the input array dimensions except for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 140 and the array at index 1 has size 141

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[35], line 1
----> 1 viz_cnmf = df.cnmf.viz()
      2 viz_cnmf.show()

File c:\software\mesmerize-viz\mesmerize_viz\_cnmf.py:1194, in CNMFDataFrameVizExtension.viz(self, start_index, temporal_data_option, image_data_options, temporal_kwargs, reset_timepoint_on_change, input_movie_kwargs, image_widget_kwargs, data_grid_kwargs)
   1118 def viz(
   1119     self,
   1120     start_index: int = None,
   (...)
   1127     data_grid_kwargs: dict = None,
   1128 ):
   1129     """
   1130     Visualize CNMF output and other data columns such as behavior video (optional).
   1131 
   (...)
   1191         Example: `image_widget_kwargs={"cmap": "viridis"}`
   1192     """
-> 1194     container = CNMFVizContainer(
   1195         dataframe=self._dataframe,
   1196         start_index=start_index,
   1197         temporal_data_option=temporal_data_option,
   1198         image_data_options=image_data_options,
   1199         temporal_kwargs=temporal_kwargs,
   1200         reset_timepoint_on_change=reset_timepoint_on_change,
   1201         input_movie_kwargs=input_movie_kwargs,
   1202         image_widget_kwargs=image_widget_kwargs,
   1203         data_grid_kwargs=data_grid_kwargs,
   1204 
   1205     )
   1207     return container

File c:\software\mesmerize-viz\mesmerize_viz\_cnmf.py:584, in CNMFVizContainer.__init__(self, dataframe, start_index, temporal_data_option, image_data_options, temporal_kwargs, reset_timepoint_on_change, input_movie_kwargs, image_widget_kwargs, data_grid_kwargs)
    581 self._cnmf_obj: CNMF = None
    583 data_arrays = self._get_row_data(index=start_index)
--> 584 self._set_data(data_arrays)
    586 self._set_params_text_area(index=start_index)
    588 self._widget = None

File c:\software\mesmerize-viz\mesmerize_viz\_cnmf.py:720, in CNMFVizContainer._set_data(self, data_arrays)
    717 self._synchronizer.add(self._linear_selector_heatmap)
    719 if self._image_widget is None:
--> 720     self._image_widget = fpl.ImageWidget(
    721         data=data_arrays["images"],
    722         names=self._image_data_options,
    723         **self.image_widget_kwargs
    724     )
    726     self._image_widget.gridplot.renderer.add_event_handler(self._manual_toggle_component, "key_down")
    728     # need to start it here so that we can access the toolbar to link events with the slider

File ~\miniforge3\envs\mescore\lib\site-packages\fastplotlib\widgets\image.py:564, in ImageWidget.__init__(self, data, dims_order, slider_dims, window_funcs, frame_apply, grid_shape, names, grid_plot_kwargs, histogram_widget, **kwargs)
    561 subplot.set_title(name)
    563 if histogram_widget:
--> 564     hlut = HistogramLUT(
    565         data=d,
    566         image_graphic=ig,
    567         name="histogram_lut"
    568     )
    570     subplot.docks["right"].add_graphic(hlut)
    571     subplot.docks["right"].size = 80

File ~\miniforge3\envs\mescore\lib\site-packages\fastplotlib\widgets\histogram_lut.py:46, in HistogramLUT.__init__(self, data, image_graphic, nbins, flank_divisor, **kwargs)
     42 self._scale_factor: float = 1.0
     44 hist, edges, hist_scaled, edges_flanked = self._calculate_histogram(data)
---> 46 line_data = np.column_stack([hist_scaled, edges_flanked])
     48 self.line = LineGraphic(line_data)
     50 bounds = (edges[0], edges[-1])

File ~\miniforge3\envs\mescore\lib\site-packages\numpy\lib\shape_base.py:652, in column_stack(tup)
    650         arr = array(arr, copy=False, subok=True, ndmin=2).T
    651     arrays.append(arr)
--> 652 return _nx.concatenate(arrays, 1)

ValueError: all the input array dimensions except for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 140 and the array at index 1 has size 141
kushalkolar commented 10 months ago

This is a bug in our histogram calculation that shows up sometimes, if you re-run CNMF you will get a slightly different result and probably won't encounter the bug. We will fix it in the coming weeks.

qweasdf1354 commented 10 months ago

Hi Kushal! that is make sense! I run it correctly sometimes! and Mcorr is too when i set the processes = 4, it sometimes can run correctly!

kushalkolar commented 10 months ago

fixed in fastplotlib main, will be out in next release. If you want it now you can follow the developer install: https://github.com/fastplotlib/fastplotlib#for-developers

qweasdf1354 commented 10 months ago

Hi Kushal! I wanna to know why sometimes i can run the mcorr and cnmf correctly after set the processes = 4,and most of time I can not run it correctly. the cpu utility will be zero after 1 or 2 minutes

kushalkolar commented 10 months ago

How large are the files? How much ram do you have? What's the traceback?

On Thu, Nov 16, 2023, 03:30 qweasdf1354 @.***> wrote:

Hi Kushal! I wanna to know why sometimes i can run the mcorr and cnmf correctly after set the processes = 4,and most of time I can not run it correctly. the cpu utility will be zero after 1 or 2 minutes

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

qweasdf1354 commented 10 months ago

bigtiff file is 9GB and I have 512GB RAM ,there is no traceback, most of times it went 0 and continue 5-60min and no change. sometimes i can run it correctly and it will not go zero or a few second

kushalkolar commented 10 months ago

What's the output in the notebook when you run it

On Thu, Nov 16, 2023, 03:44 qweasdf1354 @.***> wrote:

bigtiff file is 9GB and I have 512GB RAM ,there is no traceback, most of times it went 0 and continue 5-60min and no change. sometimes i can run it correctly and it will not go zero or a few second

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

qweasdf1354 commented 10 months ago

in the mcorr it remain the starting mc and not change for a long time. the note book show the following :

Running 5ff5eacf-2908-4e2b-a434-dc4c2c455e6e with local backend
starting mc

sometimes the cpu utility reduce to 0 and a few second it recover and show the following:

 mc finished successfully!
computing projections
Computing correlation image
finished computing correlation image
qweasdf1354 commented 10 months ago

I mean the cpu utility recover and it show

mc finished successfully!
computing projections

and for a period of time it show the

 mc finished successfully!
computing projections
Computing correlation image
finished computing correlation image
qweasdf1354 commented 10 months ago

Almost the same operation I use to start the running the notebook, however i meet some unexpected condition, i don't know what happens

qweasdf1354 commented 10 months ago

When i shut down the kernel it occurs following

[W 2023-11-16 17:02:57.834 LabApp] Could not determine jupyterlab build status without nodejs
[I 2023-11-16 17:02:58.799 ServerApp] Kernel started: 1df9cea5-c4c0-4826-8018-7f3741f6a697
[I 2023-11-16 17:02:59.872 ServerApp] Connecting to kernel 1df9cea5-c4c0-4826-8018-7f3741f6a697.
[I 2023-11-16 17:02:59.872 ServerApp] Connecting to kernel 1df9cea5-c4c0-4826-8018-7f3741f6a697.
[I 2023-11-16 17:02:59.899 ServerApp] Connecting to kernel 1df9cea5-c4c0-4826-8018-7f3741f6a697.
[I 2023-11-16 17:04:58.547 ServerApp] Saving file at /0724_230221_WT/mcorr_cnmf.ipynb
Process SpawnPoolWorker-11:
Process SpawnPoolWorker-10:
Process SpawnPoolWorker-9:
Process SpawnPoolWorker-7:
Process SpawnPoolWorker-4:
Process SpawnPoolWorker-2:
Process SpawnPoolWorker-5:
Process SpawnPoolWorker-3:
Process SpawnPoolWorker-6:
Traceback (most recent call last):
Traceback (most recent call last):
Traceback (most recent call last):
Traceback (most recent call last):
Process SpawnPoolWorker-1:
Traceback (most recent call last):
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
Traceback (most recent call last):
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
Traceback (most recent call last):
Traceback (most recent call last):
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
Traceback (most recent call last):
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
Traceback (most recent call last):
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\pool.py", line 114, in worker
    task = get()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\pool.py", line 114, in worker
    task = get()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\pool.py", line 114, in worker
    task = get()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\pool.py", line 114, in worker
    task = get()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\pool.py", line 114, in worker
    task = get()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\pool.py", line 114, in worker
    task = get()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\queues.py", line 364, in get
    with self._rlock:
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\queues.py", line 364, in get
    with self._rlock:
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\pool.py", line 114, in worker
    task = get()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\queues.py", line 364, in get
    with self._rlock:
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\queues.py", line 364, in get
    with self._rlock:
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\queues.py", line 364, in get
    with self._rlock:
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\queues.py", line 364, in get
    with self._rlock:
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\synchronize.py", line 95, in __enter__
    return self._semlock.__enter__()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\synchronize.py", line 95, in __enter__
    return self._semlock.__enter__()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\synchronize.py", line 95, in __enter__
    return self._semlock.__enter__()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\queues.py", line 364, in get
    with self._rlock:
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\synchronize.py", line 95, in __enter__
    return self._semlock.__enter__()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\pool.py", line 114, in worker
    task = get()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\synchronize.py", line 95, in __enter__
    return self._semlock.__enter__()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\pool.py", line 114, in worker
    task = get()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\synchronize.py", line 95, in __enter__
    return self._semlock.__enter__()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\pool.py", line 114, in worker
    task = get()
KeyboardInterrupt
KeyboardInterrupt
KeyboardInterrupt
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\synchronize.py", line 95, in __enter__
    return self._semlock.__enter__()
KeyboardInterrupt
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\queues.py", line 365, in get
    res = self._reader.recv_bytes()
KeyboardInterrupt
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\queues.py", line 364, in get
    with self._rlock:
KeyboardInterrupt
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\queues.py", line 365, in get
    res = self._reader.recv_bytes()
KeyboardInterrupt
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\connection.py", line 218, in recv_bytes
    self._check_readable()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\synchronize.py", line 95, in __enter__
    return self._semlock.__enter__()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\connection.py", line 221, in recv_bytes
    buf = self._recv_bytes(maxlength)
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\connection.py", line 143, in _check_readable
    def _check_readable(self):
KeyboardInterrupt
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\connection.py", line 310, in _recv_bytes
    waitres = _winapi.WaitForMultipleObjects(
KeyboardInterrupt
KeyboardInterrupt
[I 2023-11-16 17:06:18.736 ServerApp] Interrupted...
[IPKernelApp] WARNING | Parent appears to have exited, shutting down.

(mescore) D:\Step3_Extraction>Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\spawn.py", line 126, in _main
    self = reduction.pickle.load(from_parent)
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\connection.py", line 967, in rebuild_pipe_connection
    handle = dh.detach()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\reduction.py", line 131, in detach
Traceback (most recent call last):
Traceback (most recent call last):
Traceback (most recent call last):
    return _winapi.DuplicateHandle(
  File "<string>", line 1, in <module>
  File "<string>", line 1, in <module>
  File "<string>", line 1, in <module>
PermissionError: [WinError 5] 拒绝访问。
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\spawn.py", line 116, in spawn_main
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\spawn.py", line 116, in spawn_main
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
    exitcode = _main(fd, parent_sentinel)
    exitcode = _main(fd, parent_sentinel)
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\spawn.py", line 126, in _main
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\spawn.py", line 126, in _main
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\spawn.py", line 126, in _main
    self = reduction.pickle.load(from_parent)
    self = reduction.pickle.load(from_parent)
    self = reduction.pickle.load(from_parent)
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\connection.py", line 967, in rebuild_pipe_connection
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\connection.py", line 967, in rebuild_pipe_connection
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\connection.py", line 967, in rebuild_pipe_connection
    handle = dh.detach()
Traceback (most recent call last):
    handle = dh.detach()
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\reduction.py", line 131, in detach
    handle = dh.detach()
  File "<string>", line 1, in <module>
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\reduction.py", line 131, in detach
    return _winapi.DuplicateHandle(
PermissionError: [WinError 5] 拒绝访问。
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\spawn.py", line 107, in spawn_main
    return _winapi.DuplicateHandle(
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\reduction.py", line 131, in detach
    new_handle = reduction.duplicate(pipe_handle,
PermissionError: [WinError 5] 拒绝访问。
    return _winapi.DuplicateHandle(
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\reduction.py", line 79, in duplicate
PermissionError: [WinError 5] 拒绝访问。
    return _winapi.DuplicateHandle(
PermissionError: [WinError 5] 拒绝访问。
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\spawn.py", line 107, in spawn_main
    new_handle = reduction.duplicate(pipe_handle,
  File "C:\Users\PS\miniforge3\envs\mescore\lib\multiprocessing\reduction.py", line 79, in duplicate
    return _winapi.DuplicateHandle(
PermissionError: [WinError 5] 拒绝访问。
kushalkolar commented 10 months ago

I mean the cpu utility recover and it show

mc finished successfully!
computing projections

and for a period of time it show the

 mc finished successfully!
computing projections
Computing correlation image
finished computing correlation image

It can take a while to compute the correlation images and projections, and this calculation isn't multithreaded (as far as I know).

qweasdf1354 commented 10 months ago

I mean sometimes it can go to the step correctly which compute the correlation images and projections, sometimes it can not because the cpu utility is went 0 for more than 1 hour

qweasdf1354 commented 10 months ago

it sometimes can run a long time and no change in the notebook, could you help me to find if there something i am doing wrong?

kushalkolar commented 10 months ago

How long does it take if you try to calculate the correlation image manually? We can change the correlation image calculation so that it's heavily subsampled, and do some of the projections lazily (standard deviation is more complicated to do lazily).

qweasdf1354 commented 10 months ago

Sorry I do not know what is the correlation image manually. if the notebook can run, the algo_duration of mcorr is 1108.35 sec, the cnmf is 1876.19 sec. However almost it will seems some unexpected for more than 1hour in starting mc

qweasdf1354 commented 10 months ago

the notebook can run normally as if the mcorr and cnmf can run without cup utility go zero

kushalkolar commented 10 months ago
from caiman.summary_images import correlation_pnr

# increase 2 to some other value to subsample more
corr, pnr = correlation_pnr(movie[::2], gSig=gSig, swap_dim=False)
qweasdf1354 commented 10 months ago

I just tried it with ubuntu and found out, after df.iloc[0].caiman.run() the top command shows inthe COMMAND column, the python command is disappear after 1-2 minutes

qweasdf1354 commented 10 months ago
from caiman.summary_images import correlation_pnr

# increase 2 to some other value to subsample more
corr, pnr = correlation_pnr(movie[::2], gSig=gSig, swap_dim=False)

where should i run this code. is that could be run before thedf.iloc[0].caiman.run()

kushalkolar commented 10 months ago

This is a function to make the correlation image from the movie.

qweasdf1354 commented 10 months ago

Hi author,when i set the n_processes = 4 the ubuntu can run it. but i am not sure it could run correctly next time. the current question is i can not install pyqt6 in ubuntu thus when i run the viz, the following error occur

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[26], line 1
----> 1 viz = df.mcorr.viz()
      2 viz.show()

File ~/Software/mesmerize-viz/mesmerize_viz/_mcorr.py:446, in MCorrDataFrameVizExtension.viz(self, data_options, start_index, reset_timepoint_on_change, input_movie_kwargs, image_widget_kwargs, data_grid_kwargs)
    396 def viz(
    397         self,
    398         data_options: List[str] = None,
   (...)
    403         data_grid_kwargs: dict = None,
    404 ):
    405     """
    406     Visualize motion correction output.
    407 
   (...)
    443         widget that contains the DataGrid, params text box and ImageWidget
    444     """
--> 446     container = McorrVizContainer(
    447         dataframe=self._dataframe,
    448         data_options=data_options,
    449         start_index=start_index,
    450         reset_timepoint_on_change=reset_timepoint_on_change,
    451         input_movie_kwargs=input_movie_kwargs,
    452         image_widget_kwargs=image_widget_kwargs,
    453         data_grid_kwargs=data_grid_kwargs
    454     )
    456     return container

File ~/Software/mesmerize-viz/mesmerize_viz/_mcorr.py:218, in McorrVizContainer.__init__(self, dataframe, data_options, start_index, reset_timepoint_on_change, input_movie_kwargs, image_widget_kwargs, data_grid_kwargs)
    215 # set the initial widget state with the start index
    216 data_arrays = self._get_row_data(index=start_index)
--> 218 self._image_widget = ImageWidget(
    219     data=data_arrays,
    220     names=self._data_options,
    221     **self.image_widget_kwargs
    222 )
    224 # mean window slider
    225 self._slider_mean_window = IntSlider(
    226     min=1,
    227     step=2,
   (...)
    231     description_tooltip="set a mean rolling window"
    232 )

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/fastplotlib/widgets/image.py:548, in ImageWidget.__init__(self, data, dims_order, slider_dims, window_funcs, frame_apply, grid_shape, names, grid_plot_kwargs, histogram_widget, **kwargs)
    544 # update the default kwargs with any user-specified kwargs
    545 # user specified kwargs will overwrite the defaults
    546 grid_plot_kwargs_default.update(grid_plot_kwargs)
--> 548 self._gridplot: GridPlot = GridPlot(shape=grid_shape, **grid_plot_kwargs_default)
    550 for data_ix, (d, subplot) in enumerate(zip(self.data, self.gridplot)):
    551     if self._names is not None:

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/fastplotlib/layouts/_gridplot.py:79, in GridPlot.__init__(self, shape, cameras, controllers, canvas, renderer, size, **kwargs)
     42 """
     43 A grid of subplots.
     44 
   (...)
     74 
     75 """
     77 self.shape = shape
---> 79 canvas, renderer = make_canvas_and_renderer(canvas, renderer)
     81 if isinstance(cameras, str):
     82     if cameras not in valid_cameras:

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/fastplotlib/layouts/_utils.py:88, in make_canvas_and_renderer(canvas, renderer)
     82     raise ValueError(
     83         f"canvas option must either be a valid WgpuCanvas implementation, a pygfx Texture"
     84         f" or a str from the following options: {CANVAS_OPTIONS}"
     85     )
     87 if renderer is None:
---> 88     renderer = WgpuRenderer(canvas)
     90 return canvas, renderer

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/pygfx/renderers/wgpu/_renderer.py:136, in WgpuRenderer.__init__(self, target, pixel_ratio, show_fps, blend_mode, sort_objects, enable_events, gamma_correction, *args, **kwargs)
    133 self.pixel_ratio = pixel_ratio
    135 # Make sure we have a shared object (the first renderer creates the instance)
--> 136 self._shared = get_shared()
    137 self._device = self._shared.device
    139 # Init counter to auto-clear

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/pygfx/renderers/wgpu/_shared.py:146, in get_shared()
    141 """Get the globally shared instance. Creates it if it does not yet exist.
    142 This should not be called at the import time of any module.
    143 Use this to get the global device: `get_shared().device`.
    144 """
    145 if Shared._instance is None:
--> 146     Shared()
    147 return Shared._instance

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/pygfx/renderers/wgpu/_shared.py:55, in Shared.__init__(self, canvas)
     50 Shared._instance = self
     52 # Create adapter and device objects - there should be just one per
     53 # process. Having a global device provides the benefit that we can draw
     54 # any object anywhere.
---> 55 self._adapter = wgpu.gpu.request_adapter(power_preference="high-performance")
     56 self._device = self.adapter.request_device(
     57     required_features=list(Shared._features), required_limits={}
     58 )
     60 # Create a uniform buffer for std info
     61 # Stored on _store so if we'd ever swap it out for another buffer,
     62 # the pipeline automatically update.

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/wgpu/base.py:98, in GPU.request_adapter(self, power_preference, force_fallback_adapter, canvas)
     87 """Create a `GPUAdapter`, the object that represents an abstract wgpu
     88 implementation, from which one can request a `GPUDevice`.
     89 
   (...)
     95         be able to render to. This can typically be left to None.
     96 """
     97 # If this method gets called, no backend has been loaded yet, let's do that now!
---> 98 from .backends.auto import gpu  # noqa
    100 return gpu.request_adapter(
    101     power_preference=power_preference,
    102     force_fallback_adapter=force_fallback_adapter,
    103     canvas=canvas,
    104 )

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/wgpu/backends/auto.py:27
     23     else:
     24         return _load_backend("wgpu_native")
---> 27 gpu = _auto_load_backend()

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/wgpu/backends/auto.py:24, in _auto_load_backend()
     22     return _load_backend("js_webgpu")
     23 else:
---> 24     return _load_backend("wgpu_native")

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/wgpu/backends/auto.py:9, in _load_backend(backend_name)
      6 """Load a wgpu backend by name."""
      8 if backend_name == "wgpu_native":
----> 9     from . import wgpu_native as module  # noqa: F401,F403
     10 elif backend_name == "js_webgpu":
     11     from . import js_webgpu as module  # noqa: F401,F403

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/wgpu/backends/wgpu_native/__init__.py:5
      1 """
      2 The wgpu-native backend.
      3 """
----> 5 from ._api import *  # noqa: F401, F403
      6 from ._ffi import ffi, lib, lib_path, lib_version_info  # noqa: F401
      7 from ._ffi import _check_expected_version

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/wgpu/backends/wgpu_native/_api.py:28
     25 from ... import base, flags, enums, structs
     26 from ..._coreutils import str_flag_to_int
---> 28 from ._ffi import ffi, lib
     29 from ._mappings import cstructfield2enum, enummap, enum_str2int, enum_int2str
     30 from ._helpers import (
     31     get_wgpu_instance,
     32     get_surface_id_from_canvas,
   (...)
     38     SafeLibCalls,
     39 )

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/wgpu/backends/wgpu_native/_ffi.py:152
    150 ffi.cdef(get_wgpu_header())
    151 ffi.set_source("wgpu.h", None)
--> 152 lib_path = get_wgpu_lib_path()  # store path on this module so it can be checked
    153 lib = ffi.dlopen(lib_path)
    154 lib_version_info = get_lib_version_info()

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/wgpu/backends/wgpu_native/_ffi.py:89, in get_wgpu_lib_path()
     87     download_hint = _maybe_get_hint_on_download_script()
     88     pip_hint = _maybe_get_pip_hint()
---> 89     raise RuntimeError(
     90         f"Could not find WGPU library in {embedded_path}. {download_hint} {pip_hint}"
     91     )
     92 else:
     93     return embedded_path

RuntimeError: Could not find WGPU library in /home/ps/miniforge3/envs/mescore/lib/python3.11/site-packages/wgpu/resources/libwgpu_native-release.so.  
qweasdf1354 commented 10 months ago

when i run the pip install pyqt6 it occur

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pyqt6
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/17/dc/969e2da415597b328e6a73dc233f9bb4f2b312889180e9bbe48470c957e7/PyQt6-6.6.0.tar.gz (1.0 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      Querying qmake about your Qt installation...
      Traceback (most recent call last):
        File "/home/ps/miniforge3/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/ps/miniforge3/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/ps/miniforge3/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel
          whl_basename = backend.build_wheel(metadata_directory, config_settings)
        File "/tmp/pip-build-env-_xej4r2z/overlay/lib/python3.10/site-packages/sipbuild/api.py", line 46, in build_wheel
          project = AbstractProject.bootstrap('wheel',
        File "/tmp/pip-build-env-_xej4r2z/overlay/lib/python3.10/site-packages/sipbuild/abstract_project.py", line 87, in bootstrap
          project.setup(pyproject, tool, tool_description)
        File "/tmp/pip-build-env-_xej4r2z/overlay/lib/python3.10/site-packages/sipbuild/project.py", line 602, in setup
          self.update(tool)
        File "/tmp/pip-install-791r9wxd/pyqt6_dbdc74e1aa204501afe455a590548707/project.py", line 163, in update
          raise UserException(
      sipbuild.exceptions.UserException
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
kushalkolar commented 10 months ago

You don't need pyqt if to just run the viz in the notebook, %gui qt is just there to show you how you can use it if you want. If you remove %gui qt it will run in the notebook.

qweasdf1354 commented 10 months ago

Hi author,when i set the n_processes = 4 the ubuntu can run it. but i am not sure it could run correctly next time. the current question is i can not install pyqt6 in ubuntu thus when i run the viz, the following error occur

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[26], line 1
----> 1 viz = df.mcorr.viz()
      2 viz.show()

File ~/Software/mesmerize-viz/mesmerize_viz/_mcorr.py:446, in MCorrDataFrameVizExtension.viz(self, data_options, start_index, reset_timepoint_on_change, input_movie_kwargs, image_widget_kwargs, data_grid_kwargs)
    396 def viz(
    397         self,
    398         data_options: List[str] = None,
   (...)
    403         data_grid_kwargs: dict = None,
    404 ):
    405     """
    406     Visualize motion correction output.
    407 
   (...)
    443         widget that contains the DataGrid, params text box and ImageWidget
    444     """
--> 446     container = McorrVizContainer(
    447         dataframe=self._dataframe,
    448         data_options=data_options,
    449         start_index=start_index,
    450         reset_timepoint_on_change=reset_timepoint_on_change,
    451         input_movie_kwargs=input_movie_kwargs,
    452         image_widget_kwargs=image_widget_kwargs,
    453         data_grid_kwargs=data_grid_kwargs
    454     )
    456     return container

File ~/Software/mesmerize-viz/mesmerize_viz/_mcorr.py:218, in McorrVizContainer.__init__(self, dataframe, data_options, start_index, reset_timepoint_on_change, input_movie_kwargs, image_widget_kwargs, data_grid_kwargs)
    215 # set the initial widget state with the start index
    216 data_arrays = self._get_row_data(index=start_index)
--> 218 self._image_widget = ImageWidget(
    219     data=data_arrays,
    220     names=self._data_options,
    221     **self.image_widget_kwargs
    222 )
    224 # mean window slider
    225 self._slider_mean_window = IntSlider(
    226     min=1,
    227     step=2,
   (...)
    231     description_tooltip="set a mean rolling window"
    232 )

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/fastplotlib/widgets/image.py:548, in ImageWidget.__init__(self, data, dims_order, slider_dims, window_funcs, frame_apply, grid_shape, names, grid_plot_kwargs, histogram_widget, **kwargs)
    544 # update the default kwargs with any user-specified kwargs
    545 # user specified kwargs will overwrite the defaults
    546 grid_plot_kwargs_default.update(grid_plot_kwargs)
--> 548 self._gridplot: GridPlot = GridPlot(shape=grid_shape, **grid_plot_kwargs_default)
    550 for data_ix, (d, subplot) in enumerate(zip(self.data, self.gridplot)):
    551     if self._names is not None:

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/fastplotlib/layouts/_gridplot.py:79, in GridPlot.__init__(self, shape, cameras, controllers, canvas, renderer, size, **kwargs)
     42 """
     43 A grid of subplots.
     44 
   (...)
     74 
     75 """
     77 self.shape = shape
---> 79 canvas, renderer = make_canvas_and_renderer(canvas, renderer)
     81 if isinstance(cameras, str):
     82     if cameras not in valid_cameras:

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/fastplotlib/layouts/_utils.py:88, in make_canvas_and_renderer(canvas, renderer)
     82     raise ValueError(
     83         f"canvas option must either be a valid WgpuCanvas implementation, a pygfx Texture"
     84         f" or a str from the following options: {CANVAS_OPTIONS}"
     85     )
     87 if renderer is None:
---> 88     renderer = WgpuRenderer(canvas)
     90 return canvas, renderer

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/pygfx/renderers/wgpu/_renderer.py:136, in WgpuRenderer.__init__(self, target, pixel_ratio, show_fps, blend_mode, sort_objects, enable_events, gamma_correction, *args, **kwargs)
    133 self.pixel_ratio = pixel_ratio
    135 # Make sure we have a shared object (the first renderer creates the instance)
--> 136 self._shared = get_shared()
    137 self._device = self._shared.device
    139 # Init counter to auto-clear

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/pygfx/renderers/wgpu/_shared.py:146, in get_shared()
    141 """Get the globally shared instance. Creates it if it does not yet exist.
    142 This should not be called at the import time of any module.
    143 Use this to get the global device: `get_shared().device`.
    144 """
    145 if Shared._instance is None:
--> 146     Shared()
    147 return Shared._instance

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/pygfx/renderers/wgpu/_shared.py:55, in Shared.__init__(self, canvas)
     50 Shared._instance = self
     52 # Create adapter and device objects - there should be just one per
     53 # process. Having a global device provides the benefit that we can draw
     54 # any object anywhere.
---> 55 self._adapter = wgpu.gpu.request_adapter(power_preference="high-performance")
     56 self._device = self.adapter.request_device(
     57     required_features=list(Shared._features), required_limits={}
     58 )
     60 # Create a uniform buffer for std info
     61 # Stored on _store so if we'd ever swap it out for another buffer,
     62 # the pipeline automatically update.

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/wgpu/base.py:98, in GPU.request_adapter(self, power_preference, force_fallback_adapter, canvas)
     87 """Create a `GPUAdapter`, the object that represents an abstract wgpu
     88 implementation, from which one can request a `GPUDevice`.
     89 
   (...)
     95         be able to render to. This can typically be left to None.
     96 """
     97 # If this method gets called, no backend has been loaded yet, let's do that now!
---> 98 from .backends.auto import gpu  # noqa
    100 return gpu.request_adapter(
    101     power_preference=power_preference,
    102     force_fallback_adapter=force_fallback_adapter,
    103     canvas=canvas,
    104 )

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/wgpu/backends/auto.py:27
     23     else:
     24         return _load_backend("wgpu_native")
---> 27 gpu = _auto_load_backend()

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/wgpu/backends/auto.py:24, in _auto_load_backend()
     22     return _load_backend("js_webgpu")
     23 else:
---> 24     return _load_backend("wgpu_native")

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/wgpu/backends/auto.py:9, in _load_backend(backend_name)
      6 """Load a wgpu backend by name."""
      8 if backend_name == "wgpu_native":
----> 9     from . import wgpu_native as module  # noqa: F401,F403
     10 elif backend_name == "js_webgpu":
     11     from . import js_webgpu as module  # noqa: F401,F403

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/wgpu/backends/wgpu_native/__init__.py:5
      1 """
      2 The wgpu-native backend.
      3 """
----> 5 from ._api import *  # noqa: F401, F403
      6 from ._ffi import ffi, lib, lib_path, lib_version_info  # noqa: F401
      7 from ._ffi import _check_expected_version

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/wgpu/backends/wgpu_native/_api.py:28
     25 from ... import base, flags, enums, structs
     26 from ..._coreutils import str_flag_to_int
---> 28 from ._ffi import ffi, lib
     29 from ._mappings import cstructfield2enum, enummap, enum_str2int, enum_int2str
     30 from ._helpers import (
     31     get_wgpu_instance,
     32     get_surface_id_from_canvas,
   (...)
     38     SafeLibCalls,
     39 )

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/wgpu/backends/wgpu_native/_ffi.py:152
    150 ffi.cdef(get_wgpu_header())
    151 ffi.set_source("wgpu.h", None)
--> 152 lib_path = get_wgpu_lib_path()  # store path on this module so it can be checked
    153 lib = ffi.dlopen(lib_path)
    154 lib_version_info = get_lib_version_info()

File ~/miniforge3/envs/mescore/lib/python3.11/site-packages/wgpu/backends/wgpu_native/_ffi.py:89, in get_wgpu_lib_path()
     87     download_hint = _maybe_get_hint_on_download_script()
     88     pip_hint = _maybe_get_pip_hint()
---> 89     raise RuntimeError(
     90         f"Could not find WGPU library in {embedded_path}. {download_hint} {pip_hint}"
     91     )
     92 else:
     93     return embedded_path

RuntimeError: Could not find WGPU library in /home/ps/miniforge3/envs/mescore/lib/python3.11/site-packages/wgpu/resources/libwgpu_native-release.so.  

However I encounter some error, is that something i set wrong?

kushalkolar commented 10 months ago

can you try this in the environment, I've seen conda have issues putting wgpu in the right place:

install -c conda-forge wgpu-py

If you're on ubuntu it's much easier and faster to just use regular python venv instead of dealing with conda.

qweasdf1354 commented 10 months ago

Sorry Kushal! i am freshbird in ubuntu and i try this code in the mescore environment and it shows that


(mescore) ps@ps:~/Software/mesmerize-core$ install -c conda-forge wgpu-py
install: cannot stat 'conda-forge': No such file or directory

should i try it in the jupyter lab?

kushalkolar commented 10 months ago

Sorry I forgot you need a "mamba " before the install

On Fri, Nov 17, 2023, 20:41 qweasdf1354 @.***> wrote:

Sorry Kushal! i am freshbird in ubuntu and i try this code in the mescore environment and it shows that

(mescore) @.***:~/Software/mesmerize-core$ install -c conda-forge wgpu-py install: cannot stat 'conda-forge': No such file or directory

should i try it in the jupyter lab?

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

qweasdf1354 commented 10 months ago

Thanks! it works and i will try the notebook now!

qweasdf1354 commented 10 months ago

Hi Kushal! it can open the user interface windows of viz however it is gray and no image. it seems loading, but it seems can not loading for a long time

qweasdf1354 commented 10 months ago

Is there something i set wrong? is it related to i set the n_processes = 4?

kushalkolar commented 10 months ago

You probably haven't installed gpu drivers

On Fri, Nov 17, 2023, 21:04 qweasdf1354 @.***> wrote:

Is there something i set wrong? is it related to i set the n_processes = 4?

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

qweasdf1354 commented 10 months ago

Screenshot from 2023-11-19 11-36-11

I reinstall the GPU driver and cuda and cudnn. the cuda version is 11.8, however the nvidia-smi shows the 12.2(which may mean the version i can install)

When i start playing the tiff, the GPU utility is about 30-50% which may represents the GPU is activate by the viz code

Is there something I need to do to see the tiff?

qweasdf1354 commented 10 months ago

Hi author, sorry to bother you, i wanna to ask for your help!! Thanks a lot!

kushalkolar commented 10 months ago

Sorry been busy. Can you try installing the mesa-vulkan-driver package too, see here: https://github.com/fastplotlib/fastplotlib#linux

Did you reboot after installing the drivers?

qweasdf1354 commented 10 months ago

Thanks for your reply! I try to reboot the computer. I install the driver and using the one in the nvidia.org recommend. I will try the mesa-vulkan-driver package

kushalkolar commented 10 months ago

can you pip install glfw and see if the following minimal example runs, just create a .py file and run it with python in that env:

import fastplotlib as fpl
import numpy as np

plot = fpl.Plot()

data = np.random.ran(100, 100)

image_graphic = plot.add_image(data)

plot.show()
qweasdf1354 commented 10 months ago

Hi kushal, I try it in the mescore env and it is grey too like before notebook.

and show the following error

libEGL warning: DRI3: Screen seems not DRI3 capable
libEGL warning: DRI2: failed to authenticate
    EGL context: -robust access
enumerate_adapters: Initialization of an object has failed
/home/ps/miniforge3/envs/mescore/lib/python3.11/site-packages/fastplotlib/graphics/_features/_base.py:34: UserWarning: converting float64 array to float32
  warn(f"converting {array.dtype} array to float32")

Screenshot from 2023-11-21 11-16-19

I just install the vulkan-drivers using following code


sudo apt-get install cmake git gcc g++ mesa-* libwayland-dev libxrandr-dev
sudo apt-get install libvulkan1 mesa-vulkan-drivers vulkan-utils
vulkaninfo

and it shows

===========
VULKAN INFO
===========

Vulkan Instance Version: 1.1.70

ERROR: [Loader Message] Code 0 : libGLX_nvidia.so.0: cannot open shared object file: No such file or directory
/build/vulkan-UL09PJ/vulkan-1.1.70+dfsg1/demos/vulkaninfo.c:2700: failed with VK_ERROR_INITIALIZATION_FAILED

Thanks!

qweasdf1354 commented 10 months ago

Hi kushal, I feel sorry to bother you and it may be the Vulkan driver not install correct. But i have try many method and I do not know how to recover the ubuntu to the state i have not install the vulkan before. i am not sure it will influence the system. and until now i think i am not really install the vulkan in ubuntu that maybe why i can not see the picture. could you give me some advice to this situation?

kushalkolar commented 10 months ago

What's your kernel version? You have a RTX 4090 which is quite new and the drivers and kernel might be a bit wonky with it.

uname -a
qweasdf1354 commented 10 months ago

the following is the results Linux ps 5.4.0-152-generic #169~18.04.1-Ubuntu SMP Wed Jun 7 22:22:24 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

kushalkolar commented 10 months ago

Ah, you're on Ubuntu 18.04 with kernel 5.4 which is from 2019, and your gpu was released 1 year ago. If you use the latest Ubuntu and latest kernel you might have better luck. New Nvidia GPUs tend to not play nicely with older kernels.

qweasdf1354 commented 10 months ago

thanks! for your reply! and is that mean i will update the ubuntu to 22.04 ?

kushalkolar commented 10 months ago

I would try the latest Ubuntu with kernel v6

On Mon, Nov 20, 2023, 23:47 qweasdf1354 @.***> wrote:

thanks! for your reply! and is that mean i will update the ubuntu to 22.04 ?

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

qweasdf1354 commented 10 months ago

Thanks kushal! I will try it too

qweasdf1354 commented 9 months ago

Hi,Kushal! i wanna to let you know! I using the Ubuntu22.04 and it done! Thanks a lot for your patient and this great tool!

kushalkolar commented 9 months ago

So the viz works on Ubuntu 22.04 with the 4090 GPU and new drivers? Nvidia drivers for new GPUs are often quite finicky on older OSes.

qweasdf1354 commented 9 months ago

Yes! i can run the notebook in ubuntu 22.04 and can see the tiff using the viz and can record a video. I wanna to know is that possible that I run the viz to see the behaviour video and neural activity tiff and some extracted neural activity trace simutanously, which i wanna to make a typical video for presentation or publication. Thanks a lot for your help!

qweasdf1354 commented 9 months ago

And may I invite you to be author in my this project, which may be accomplish in this year. I really appreciate for your help!

qweasdf1354 commented 9 months ago

Sorry i mean in the next year!