Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError while trying to run Phy2 post-sorting #1326

Open
KyleWei-UChi opened this issue Jan 19, 2025 · 0 comments
Open

AssertionError while trying to run Phy2 post-sorting #1326

KyleWei-UChi opened this issue Jan 19, 2025 · 0 comments

Comments

@KyleWei-UChi
Copy link

Hi,

I've been using kilosort 2 for sorting and phy2 for visualization/selection of units post-sorting for a while now. It usually works smoothly until today when I got a large trunk of trace back errors and a "QWidget: Must construct a QApplication before a QWidget" message.

I have limited experience with phy. From reading the errors I guess that something absurd was happening with spike templates, probably because I only got 2 sorted units form kilosort from this session. However, I used to have data with only a few units (like 2 or 3, especially when I was testing the system), and phy worked fine with those datasets.

Here I attached the error messages below - any suggestions/recommendations about solving the problem would be much appreciated!

(phy2) C:\Users\Maunsell Lab>cd C:\Users\Maunsell Lab\Documents\Lai\Meetz_250117\kilosort

(phy2) C:\Users\Maunsell Lab\Documents\Lai\Meetz_250117\kilosort>phy template-gui params.py
23:09:07.833 [W] model:667 Skipping spike waveforms that do not exist, they will be extracted on the fly from the raw data as needed.
23:09:07.836 [E] init:62 An error has occurred (AssertionError):
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\ProgramData\anaconda3\envs\phy2\Scripts\phy.exe_main
.py", line 7, in
sys.exit(phycli())
^^^^^^^^
File "C:\ProgramData\anaconda3\envs\phy2\Lib\site-packages\click\core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\phy2\Lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\phy2\Lib\site-packages\click\core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\phy2\Lib\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\phy2\Lib\site-packages\click\core.py", line 783, in invoke
return _callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\phy2\Lib\site-packages\click\decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\phy2\Lib\site-packages\phy\apps_init
.py", line 159, in cli_template_gui
template_gui(params_path, **kwargs)
File "C:\ProgramData\anaconda3\envs\phy2\Lib\site-packages\phy\apps\template\gui.py", line 209, in template_gui
model = load_model(params_path)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\phy2\Lib\site-packages\phylib\io\model.py", line 1440, in load_model
return TemplateModel(**get_template_params(params_path))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\phy2\Lib\site-packages\phylib\io\model.py", line 339, in init
self._load_data()
File "C:\ProgramData\anaconda3\envs\phy2\Lib\site-packages\phylib\io\model.py", line 446, in _load_data
assert self.similar_templates.shape == (self.n_templates, self.n_templates)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

QWidget: Must construct a QApplication before a QWidget

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant