NeuromorphicProcessorProject / snn_toolbox

Toolbox for converting analog to spiking neural networks (ANN to SNN), and running them in a spiking neuron simulator.
MIT License
362 stars 105 forks source link

Parameter sweep prevents successful parsing of the config #57

Closed RKCZ closed 4 years ago

RKCZ commented 4 years ago

Hello again, how should I use _parametersweep section of the config file? When I add the following part to my config: config['parameter_sweep'] = { 'param_values': [1, 0.1, 0.01], 'param_name': 'v_tresh' } it causes an error:

KeyError                                  Traceback (most recent call last)
/usr/lib/python3.6/configparser.py in get(self, section, option, raw, vars, fallback)
    788         try:
--> 789             value = d[option]
    790         except KeyError:

5 frames
/usr/lib/python3.6/collections/__init__.py in __getitem__(self, key)
    882                 pass
--> 883         return self.__missing__(key)            # support subclasses that define __missing__
    884 

/usr/lib/python3.6/collections/__init__.py in __missing__(self, key)
    874     def __missing__(self, key):
--> 875         raise KeyError(key)
    876 

KeyError: 'v_tresh'

During handling of the above exception, another exception occurred:

NoOptionError                             Traceback (most recent call last)
<ipython-input-4-558dc6021dcd> in <module>()
     64 
     65 # RUN SNN TOOLBOX
---> 66 main(config_filepath)

/usr/local/lib/python3.6/dist-packages/snntoolbox/bin/run.py in main(filepath)
     28 
     29     if filepath is not None:
---> 30         config = update_setup(filepath)
     31         run_pipeline(config)
     32         return

/usr/local/lib/python3.6/dist-packages/snntoolbox/bin/utils.py in update_setup(config_filepath)
    513     param_name = config.get('parameter_sweep', 'param_name')
    514     try:
--> 515         config.get('cell', param_name)
    516     except KeyError:
    517         print("Unkown parameter name {} to sweep.".format(param_name))

/usr/lib/python3.6/configparser.py in get(self, section, option, raw, vars, fallback)
    790         except KeyError:
    791             if fallback is _UNSET:
--> 792                 raise NoOptionError(option, section)
    793             else:
    794                 return fallback

NoOptionError: No option 'v_tresh' in section: 'cell'
rbodo commented 4 years ago

Try the correct spelling: "v_thresh"

RKCZ commented 4 years ago

Ah, so sorry to bother you 😞.