cortex-lab / phy

phy: interactive visualization and manual spike sorting of large-scale ephys data
BSD 3-Clause "New" or "Revised" License
307 stars 156 forks source link

Failure to launch phy GUI with index error #1176

Open lwang-lp opened 1 year ago

lwang-lp commented 1 year ago

The issue: Fail to launch phy GUI, while running: phy template-gui params.py , even with the eMouse sample dataset

I've installed kilosort and phy2 on a new Windows machine (Windows 10) with graphic card Nvidia Quatro RTX4000. Phy2 was installed on a new conda environment with Python 3.9. While I tried to test the phy installation using the sample data provided in the tutorial (eMouse or this ), the GUI failed to launch with an index error. The details of the error are shown below:

(phy) C:\DATA\Spikes\phy-data-master\template>phy template-gui params.py --debug 12:30:24.351 [D] init:68 Start capturing exceptions. 12:30:24.372 [W] model:591 Unreferenced clusters found in templates (generally not a problem) 12:30:24.372 [D] model:607 Loading spike clusters. 12:30:24.372 [W] model:613 Unreferenced clusters found in spike_clusters (generally not a problem) 12:30:24.380 [D] model:680 Loading templates. 12:30:24.395 [D] model:708 Templates are sparse. 12:30:24.395 [W] model:655 Skipping spike waveforms that do not exist, they will be extracted on the fly from the raw data as needed. 12:30:24.395 [D] model:718 Loading the whitening matrix. 12:30:24.395 [D] model:725 Loading the inverse of the whitening matrix. 12:30:24.395 [D] model:754 Loading features. 12:30:24.395 [D] model:769 Features are sparse. 12:30:24.395 [D] model:791 Loading template features. 12:30:24.395 [D] model:801 Template features are sparse. 12:30:24.395 [D] model:492 Load cluster_group.csv. 12:30:25.066 [D] context:100 Initialize joblib cache dir at C:\DATA\Spikes\phy-data-master\template\.phy. 12:30:25.074 [D] context:101 Reducing the size of the cache if needed. 12:30:25.076 [D] base:102 Add filter high_pass. 12:30:25.076 [D] config:31 Load config file C:\Users\wangl16\.phy\phy_config.py. 12:30:25.076 [D] plugin:145 Loading 0 plugins. 12:30:25.076 [D] context:209 The file C:\DATA\Spikes\phy-data-master\template\.phy\new_cluster_id.pkl doesn't exist. 12:30:25.084 [D] context:185 Save data to C:\DATA\Spikes\phy-data-master\template\.phy\spikes_per_cluster.pkl. 12:30:25.084 [D] gui:463 Creating GUI. 12:30:25.094 [D] state:46 Load C:\Users\wangl16.phy\TemplateGUI\state.json for GUIState. 12:30:25.672 [D] gui:718 Add view ClusterView to GUI. 12:30:25.679 [E] init:62 An error has occurred (IndexError): list index out of range Traceback (most recent call last): File "C:\Users\wangl16\Anaconda3\envs\phy\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\wangl16\Anaconda3\envs\phy\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\wangl16\Anaconda3\envs\phy\Scripts\phy.exe__main.py", line 7, in sys.exit(phycli()) File "C:\Users\wangl16\Anaconda3\envs\phy\lib\site-packages\click\core.py", line 1130, in call return self.main(*args, kwargs) File "C:\Users\wangl16\Anaconda3\envs\phy\lib\site-packages\click\core.py", line 1055, in main rv = self.invoke(ctx) File "C:\Users\wangl16\Anaconda3\envs\phy\lib\site-packages\click\core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\wangl16\Anaconda3\envs\phy\lib\site-packages\click\core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "C:\Users\wangl16\Anaconda3\envs\phy\lib\site-packages\click\core.py", line 760, in invoke return callback(*args, *kwargs) File "C:\Users\wangl16\Anaconda3\envs\phy\lib\site-packages\click\decorators.py", line 26, in new_func return f(get_current_context(), args, kwargs) File "C:\Users\wangl16\Anaconda3\envs\phy\lib\site-packages\phy\apps__init__.py", line 159, in cli_template_gui template_gui(params_path, kwargs) File "C:\Users\wangl16\Anaconda3\envs\phy\lib\site-packages\phy\apps\template\gui.py", line 218, in template_gui gui = controller.create_gui() File "C:\Users\wangl16\Anaconda3\envs\phy\lib\site-packages\phy\apps\base.py", line 1697, in create_gui self.supervisor.attach(gui) File "C:\Users\wangl16\Anaconda3\envs\phy\lib\site-packages\phy\cluster\supervisor.py", line 957, in attach gui.add_view(self.cluster_view, position='left', closable=False) File "C:\Users\wangl16\Anaconda3\envs\phy\lib\site-packages\phy\gui\gui.py", line 728, in add_view dock = _create_dock_widget(widget, name, closable=closable, floatable=floatable) File "C:\Users\wangl16\Anaconda3\envs\phy\lib\site-packages\phy\gui\gui.py", line 347, in _create_dock_widget dock = DockWidget(widget=widget) File "C:\Users\wangl16\Anaconda3\envs\phy\lib\site-packages\phy\gui\gui.py", line 131, in init self._font = _load_font('fa-solid-900.ttf') File "C:\Users\wangl16\Anaconda3\envs\phy\lib\site-packages\phy\gui\qt.py", line 208, in _load_font font_family = QFontDatabase.applicationFontFamilies(font_id)[0] IndexError: list index out of range

I've tried re-install phy several times, the issue still persisted. Since I was using the tutorial sample, the error seems to be only related to my phy installation. Does anyone have an idea how to solve this issue? Thanks!