AllenInstitute / licking_behavior_NP

Analysis of mouse licking behavior during visually guided behavior
0 stars 1 forks source link

behavior_model_params.json not found #16

Closed RobertoDF closed 5 months ago

RobertoDF commented 5 months ago

Hi,

Trying to get model to work on the Allen Neuropixel Behavior dataset, but I run into this :

for bsid in behavior_session_table[behavior_session_table["session_type"].str.contains("EPHYS_")][:3].index:
    ps.process_session(bsid, version=1)
Starting Fit now
Pulling Data
Loading SDK object

/alzheimer/Roberto/Software/mambaforge/envs/Visual_decoding/lib/python3.11/site-packages/allensdk/brain_observatory/behavior/stimulus_processing.py:624: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
  is_change = is_change.fillna(False)

removing passive session stimuli
Adding stimulus annotations
Annotating lick bouts

/alzheimer/Roberto/Software/mambaforge/envs/Visual_decoding/lib/python3.11/site-packages/licking_behavior_NP/psy_metrics_tools.py:126: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[ True  True  True ...  True  True  True]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  temp.update(x)
/alzheimer/Roberto/Software/mambaforge/envs/Visual_decoding/lib/python3.11/site-packages/licking_behavior_NP/psy_metrics_tools.py:126: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[ True  True  True ...  True  True  True]' has dtype incompatible with int64, please explicitly cast to a compatible dtype first.
  temp.update(x)
/alzheimer/Roberto/Software/mambaforge/envs/Visual_decoding/lib/python3.11/site-packages/licking_behavior_NP/psy_metrics_tools.py:126: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[ True  True  True ...  True  True  True]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  temp.update(x)
/alzheimer/Roberto/Software/mambaforge/envs/Visual_decoding/lib/python3.11/site-packages/licking_behavior_NP/psy_metrics_tools.py:126: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[ True  True  True ...  True  True  True]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  temp.update(x)
/alzheimer/Roberto/Software/mambaforge/envs/Visual_decoding/lib/python3.11/site-packages/licking_behavior_NP/psy_metrics_tools.py:126: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[False False  True ... False False False]' has dtype incompatible with int64, please explicitly cast to a compatible dtype first.
  temp.update(x)

Formating Data
Loading options for version 1

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
Cell In[35], line 2
      1 for bsid in behavior_session_table[behavior_session_table["session_type"].str.contains("EPHYS_")][:3].index:
----> 2     ps.process_session(bsid, version=1)

File /alzheimer/Roberto/Software/mambaforge/envs/Visual_decoding/lib/python3.11/site-packages/licking_behavior_NP/psy_tools.py:73, in process_session(bsid, complete, version, format_options, refit)
     70 pm.annotate_bouts(session)
     72 print("Formating Data")
---> 73 format_options = get_format_options(version, format_options)
     74 psydata = format_session(session,format_options)
     76 print("Initial Fit")

File /alzheimer/Roberto/Software/mambaforge/envs/Visual_decoding/lib/python3.11/site-packages/licking_behavior_NP/psy_tools.py:281, in get_format_options(version, format_options)
    277 '''
    278     Defines the default format options, and sets any values not passed in
    279 '''
    280 print('Loading options for version '+str(version))
--> 281 defaults = pgt.load_version_parameters(version)
    283 for k in defaults.keys():
    284     if k not in format_options:

File /alzheimer/Roberto/Software/mambaforge/envs/Visual_decoding/lib/python3.11/site-packages/licking_behavior_NP/psy_general_tools.py:68, in load_version_parameters(VERSION)
     66 def load_version_parameters(VERSION):
     67     json_path = BEHAVIOR_DIR+'psy_fits_v'+str(VERSION)+'/summary_data/behavior_model_params.json'
---> 68     with open(json_path,'r') as json_file:
     69         format_options = json.load(json_file)
     70     return format_options

FileNotFoundError: [Errno 2] No such file or directory: '/alzheimer/Roberto/Github/Visual_decoding/mouse_connectivity/NP/behavior/psy_fits_v1/summary_data/behavior_model_params.json'

I see that you have a folder here that contains some parameters (behavior_model_params.json). Where do I get this?

Thanks!

RobertoDF commented 5 months ago

nevermind https://github.com/AllenInstitute/licking_behavior_NP/blob/76e0c33e576e53f4d071abf9493f81cdecb38cb7/licking_behavior_NP/psy_output_tools.py#L133-L142