Open farazmoradi opened 2 years ago
I'm also seeing this error... any suggestions?
$ phy template-gui params.py
File "/software/miniconda3/4.9.2/envs/phy2/lib/python3.7/site-packages/phylib/io/model.py", line 475, in _read_array raise IOError() OSError
QWidget: Must construct a QApplication before a QWidget Aborted (core dumped)
I'm seeing a similar error after installing phy using the Developer instructions in the Readme. Has anyone seen anything like this and solved it?
`(phy) [gg121@compute-e-16-229 phylib]$ phy template-gui /n/groups/datta/guitchounts/data/gmou48/gmou48_2021-12-11_14-24-38_odor/tmp_MS4/phy/params.py
16:41:57.386 [W] model:1325 File /n/groups/datta/guitchounts/data/gmou48/gmou48_2021-12-11_14-24-38_odor/tmp_MS4/phy/None does not exist.
16:41:59.642 [E] init:62 An error has occurred (AssertionError):
Traceback (most recent call last):
File "/home/gg121/anaconda3/envs/phy/bin/phy", line 33, in
QWidget: Must construct a QApplication before a QWidget Aborted`
I saw the same issue. In my case, it was cased by an incorrect params.py, with an entry for n_channels_dat that did not match the data.
Part of the problem here is, the program aborts without a meaningful error message. In order to address this, I've applied this patch
diff --git a/phylib/io/model.py b/phylib/io/model.py
index ad008f5..e755bc9 100644
--- a/phylib/io/model.py
+++ b/phylib/io/model.py
@@ -380,6 +380,9 @@ class TemplateModel(object):
self.channel_mapping = self._load_channel_map()
self.n_channels = nc = self.channel_mapping.shape[0]
if self.n_channels_dat:
+ if not np.all(self.channel_mapping <= self.n_channels_dat - 1):
+ print("channel miss-match, check n_channels_dat in your params file %d,%d\n",self.channel_mapping,self.n_channels_dat)
+ return
assert np.all(self.channel_mapping <= self.n_channels_dat - 1)
# Channel positions.
Hi, I face a similar issue when I try to run phy.
Traceback (most recent call last):
File "D:\Labo\Anaconda\envs\phy_environment\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "D:\Labo\Anaconda\envs\phy_environment\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "D:\Labo\Anaconda\envs\phy_environment\Scripts\phy.exe__main.py", line 7, in
I tried the patch proposed by @schloegl but it doesn't change anything in my case.
Regards
Hi again,
I solved the issue. It was due to an incorrect data format using spike interface pipeline to manage the sorting. Now I scale the data and convert from int16 to float32 and it's just fine.
Best
I got the same error. When I try to debug, I get the following output. Does anyone know what the problem is?
(phy2) C:\Users\12023\Desktop\Ephys\Data\Lav74-M\Spikesorting_results\P1_BOS> phy template-gui params.py --debug 14:42:33.663 [D] init:68 Start capturing exceptions. 14:42:33.740 [W] model:603 Unreferenced clusters found in templates (generally not a problem) 14:42:33.779 [D] model:619 Loading spike clusters. 14:42:33.820 [W] model:625 Unreferenced clusters found in spike_clusters (generally not a problem) 14:42:33.867 [E] init:62 An error has occurred (AssertionError): Traceback (most recent call last): File "
Hi again,
I solved the issue. It was due to an incorrect data format using spike interface pipeline to manage the sorting. Now I scale the data and convert from int16 to float32 and it's just fine.
Best
Hey there Fred! How did you scale the data and convert from int16 to float32? Thanks, Kelvin
Hi, I received this error while running Phy on some of the sorted data!
QWidget: Must construct a QApplication before a QWidget zsh: abort phy template-gui params.py