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

Parameter sweep prevents successful parsing of the config #57

Closed
RKCZ opened this issue Apr 21, 2020 · 2 comments
Closed

Parameter sweep prevents successful parsing of the config #57

RKCZ opened this issue Apr 21, 2020 · 2 comments

Comments

@RKCZ
Copy link

RKCZ commented Apr 21, 2020

Hello again,
how should I use parameter_sweep 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
Copy link
Contributor

rbodo commented Apr 23, 2020

Try the correct spelling: "v_thresh"

@RKCZ
Copy link
Author

RKCZ commented Apr 23, 2020

Ah, so sorry to bother you 😞.

@RKCZ RKCZ closed this as completed Apr 23, 2020
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

2 participants