AdaptiveMotorControlLab / CEBRA

Learnable latent embeddings for joint behavioral and neural analysis - Official implementation of CEBRA
https://cebra.ai
Other
875 stars 66 forks source link

cebra.datasets.init throws IndexError (allen demo) #78

Closed EricThomson closed 10 months ago

EricThomson commented 10 months ago

Is there an existing issue for this?

Bug description

In early steps of Demo_Allen.ipynb, trying to load ca_train with ca.datasets.init(), I get an error.

Operating System

Windows 10

CEBRA version

0.2.0

Device type

cpu 11th gen intel i7 gpu nvidia geforce rtx 3050ti

Steps To Reproduce

Code:

cortex = 'VISp'
seed=333
num_neurons = 800
ca_train = cebra.datasets.init(f'allen-movie-one-ca-{cortex}-{num_neurons}-train-10-{seed}')

Stack trace:

File ~\miniconda3\envs\cebra\lib\site-packages\cebra\datasets\allen\ca_movie_decoding.py:176, in <listcomp>(.0)
    162 """Construct pseudomouse neural dataset.
    163 
    164 Stack the excitatory neurons from the multiple mice and construct a psuedomouse neural dataset of the specified visual cortical area.
   (...)
    169 
    170 """
    172 list_mice = glob.glob(
    173     get_datapath(
    174         f"allen/visual_drift/data/calcium_excitatory/{area}/*"))
    175 exp_containers = [
--> 176     int(mice.split(f"{area}/")[1].replace(".mat", ""))
    177     for mice in list_mice
    178 ]
    179 ## Load summary file
    180 summary = pd.read_csv(get_datapath("allen/data_summary.csv"))

IndexError: list index out of range

I went into the debugger and checked out the mice string: data\\allen/visual_drift/data/calcium_excitatory/VISp\\511498742.mat

It seems split() is getting hung up on Windows path weirdness. I have a linux machine I can switch to for running Cebra, but I just thought I'd let you know about this just in case.

Relevant log output

No response

Anything else?

No response

Code of Conduct

MMathisLab commented 10 months ago

Hi, similar to other issues, the demos are slightly ahead of the stable release, so please install 0.3.0rc1 ! We will update to a stable release this week, cc @stes

EricThomson commented 10 months ago

I upgraded, and same issue, but switched to Linux where things are good because ... don't fight the framework. :smile:

MMathisLab commented 10 months ago

Ah, I'm sorry -- I didn't read your initial post carefully. We should fix the paths asap, @gonlairo - needs to be done for rc2.

stes commented 10 months ago

We are working towards windows support in #79 now!