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

Error when run with Brian2 simulator #39

Closed ferqui closed 5 years ago

ferqui commented 5 years ago

When I run examples with the brian2 simulator, I get the following error. Could you give me some suggestions? Thank you very much.

Traceback (most recent call last):
  File "/Users/ferqui/Envs/ann-snn/bin/snntoolbox", line 10, in <module>
    sys.exit(main())
  File "/Users/ferqui/Envs/ann-snn/lib/python3.7/site-packages/snntoolbox/bin/run.py", line 50, in main
    test_full(config)
  File "/Users/ferqui/Envs/ann-snn/lib/python3.7/site-packages/snntoolbox/bin/utils.py", line 111, in test_full
    spiking_model.build(parsed_model)
  File "/Users/ferqui/Envs/ann-snn/lib/python3.7/site-packages/snntoolbox/simulation/utils.py", line 426, in build
    self.add_layer(layer)
  File "/Users/ferqui/Envs/ann-snn/lib/python3.7/site-packages/snntoolbox/simulation/target_simulators/brian2_target_sim.py", line 101, in add_layer
    self.v_reset, dt=self._dt*self.sim.ms))
  File "/Users/ferqui/Envs/ann-snn/lib/python3.7/site-packages/brian2/groups/neurongroup.py", line 500, in __init__
    model = Equations(model)
  File "/Users/ferqui/Envs/ann-snn/lib/python3.7/site-packages/brian2/equations/equations.py", line 556, in __init__
    self._equations = parse_string_equations(eqns)
  File "/Users/ferqui/Envs/ann-snn/lib/python3.7/site-packages/brian2/utils/caching.py", line 100, in cached_func
    func._cache[cache_key] = func(*args, **kwds)
  File "/Users/ferqui/Envs/ann-snn/lib/python3.7/site-packages/brian2/equations/equations.py", line 349, in parse_string_equations
    ' ' * (p_exc.column - 1) + '^\n' + str(p_exc))
brian2.equations.equations.EquationError: Parsing failed: 
v = : 1
rbodo commented 5 years ago

Hi,

Please try

self.eqs = 'v = 0 : 1'

It appears the zero has been dropped in a recent pull-request. I'll investigate.

rbodo commented 5 years ago

@ferqui Please close if this pull-request fixed the issue.