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

FileNotFoundError: cuda/mexThSpkPC.cu #47

Open
DradeAW opened this issue Nov 19, 2020 · 0 comments
Open

FileNotFoundError: cuda/mexThSpkPC.cu #47

DradeAW opened this issue Nov 19, 2020 · 0 comments

Comments

@DradeAW
Copy link

DradeAW commented Nov 19, 2020

Hi,

I tried pykilosort for the first time today, and I encountered an error that I was able to solve, so I'm sharing it here.

My code is the following:

import numpy as np
import pathlib
import pykilosort as kilosort


kilosort.add_default_handler(level="DEBUG")

dat_path = pathlib.Path("amplifier.dat")
dir_path = dat_path.parent

probe = kilosort.Bunch()
probe.NchanTOT = 64
probe.chanMap = np.arange(64)
probe.kcoords = np.ones(64)

coords = np.zeros([64, 2], dtype=np.float64)
for i in range(64):
	coords[i] = (250*(i//16) + 12.5*(i%2), 12.5*(i%16))
probe.xc = coords[:, 0]
probe.yc = coords[:, 1]

kilosort.run(dat_path, probe=probe, dir_path=dir_path, n_channels=64, dtype=np.int16, sample_rate=30000)

The error was the following:

$ python test.py 
16:17:18.254 [I] main:56              Loaded raw data with 64 channels, 48825600 samples.
16:17:18.254 [D] utils:273            Loading Wrot.npy
16:17:18.258 [I] utils:334            Starting step reorder.
Clustering spikes:   0%|                                                                                                 | 0/746 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "test.py", line 22, in <module>
    kilosort.run(dat_path, probe=probe, dir_path=dir_path, n_channels=64, dtype=np.int16, sample_rate=30000)
  File "/users/nsr/wyngaard/.conda/envs/kilosort/lib/python3.7/site-packages/pykilosort-2.0.0a0-py3.7.egg/pykilosort/main.py", line 164, in run
    out = clusterSingleBatches(ctx)
  File "/users/nsr/wyngaard/.conda/envs/kilosort/lib/python3.7/site-packages/pykilosort-2.0.0a0-py3.7.egg/pykilosort/cluster.py", line 481, in clusterSingleBatches
    proc, params, probe, wPCA, min(nBatches - 2, ibatch), iC, Nbatch)
  File "/users/nsr/wyngaard/.conda/envs/kilosort/lib/python3.7/site-packages/pykilosort-2.0.0a0-py3.7.egg/pykilosort/cluster.py", line 339, in extractPCbatch2
    uS, idchan = mexThSpkPC(Params, dataRAW, wPCA, iC)
  File "/users/nsr/wyngaard/.conda/envs/kilosort/lib/python3.7/site-packages/pykilosort-2.0.0a0-py3.7.egg/pykilosort/cluster.py", line 249, in mexThSpkPC
    code, constants = get_cuda('mexThSpkPC')
  File "/users/nsr/wyngaard/.conda/envs/kilosort/lib/python3.7/site-packages/pykilosort-2.0.0a0-py3.7.egg/pykilosort/utils.py", line 115, in get_cuda
    code = path.read_text()
  File "/users/nsr/wyngaard/.conda/envs/kilosort/lib/python3.7/pathlib.py", line 1221, in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
  File "/users/nsr/wyngaard/.conda/envs/kilosort/lib/python3.7/pathlib.py", line 1208, in open
    opener=self._opener)
  File "/users/nsr/wyngaard/.conda/envs/kilosort/lib/python3.7/pathlib.py", line 1063, in _opener
    return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/users/nsr/wyngaard/.conda/envs/kilosort/lib/python3.7/site-packages/pykilosort-2.0.0a0-py3.7.egg/pykilosort/cuda/mexThSpkPC.cu'

(kilosort) wyngaard@nspc05:~/Documents/bug/kilosort$ locate mexThSpkPC.cu
/export/home1/users/nsr/wyngaard/dev/kilosort/pykilosort/pykilosort/cuda/mexThSpkPC.cu

I was able to solve the issue my modifying line 115 of the file pykilosort/utils.py to match where my mexThSpkPC.cu was.

Hope this helps!

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