Skip to content

"ValueError: invalid literal for int() with base 10: '-'" When running phmm.HmmHandler() with multiple tastes in params #52

@danielsvedberg

Description

@danielsvedberg

Attempted to run HMMs with all tastes bundled into one model. (with params[{'taste':['Suc','NaCl','CA','QHCl']) Everything runs ok until it's time to save, then I get the message:

ValueError                                Traceback (most recent call last)
~/hmm_script.py in <module>
     18         handler = phmm.HmmHandler(rec_dir)
     19         handler.add_params(params)
---> 20         handler.run(constraint_func = phmm.sequential_constraint)

~/miniconda3/envs/blechpy/lib/python3.7/site-packages/blechpy/analysis/poissonHMM.py in run(self, parallel, overwrite, constraint_func, n_cpu)
   1312 
   1313         #self.plot_saved_models()
-> 1314         self.load_params()
   1315 
   1316     def plot_spike_rasters(self):

~/miniconda3/envs/blechpy/lib/python3.7/site-packages/blechpy/analysis/poissonHMM.py in load_params(self)
   1229             return
   1230 
-> 1231         overview = self.get_data_overview()
   1232         if overview.empty:
   1233             return

~/miniconda3/envs/blechpy/lib/python3.7/site-packages/blechpy/analysis/poissonHMM.py in get_data_overview(self)
   1249 
   1250     def get_data_overview(self):
-> 1251         return hmmIO.get_hmm_overview_from_hdf5(self.h5_file)
   1252 
   1253     def remove_params(self, index):

~/miniconda3/envs/blechpy/lib/python3.7/site-packages/blechpy/dio/hmmIO.py in get_hmm_overview_from_hdf5(h5_file)
    291     params = []
    292     for i in ids:
--> 293         _, _, _, _, p = read_hmm_from_hdf5(h5_file, i)
    294         params.append(p)
    295 

~/miniconda3/envs/blechpy/lib/python3.7/site-packages/blechpy/dio/hmmIO.py in read_hmm_from_hdf5(h5_file, hmm_id)
    112 
    113             if isinstance(params['taste'], list):
--> 114                 params['channel'] = list_channel_hash(params['channel'])
    115 
    116             return PI, A, B, stat_arrays, params

~/miniconda3/envs/blechpy/lib/python3.7/site-packages/blechpy/dio/hmmIO.py in list_channel_hash(num)
    305 
    306 def list_channel_hash(num):
--> 307     tmp = [int(x) for x in str(num)]
    308     return tmp[1:]
    309 

~/miniconda3/envs/blechpy/lib/python3.7/site-packages/blechpy/dio/hmmIO.py in <listcomp>(.0)
    305 
    306 def list_channel_hash(num):
--> 307     tmp = [int(x) for x in str(num)]
    308     return tmp[1:]
    309 

ValueError: invalid literal for int() with base 10: '-'

Will re-run on desktop with looser params to debug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions