BrianObjectException: Error encountered with object named "neurongroup_thresholder"

Description of problem

I am trying to simulate a convolutional spiking neural network with mnist dataset. When I am trying to use the network.run function, it is giving me this error but I can run my code using brian1 and only run function. In brian2 when I am using only run function it can not get the output spikes from my excitatory layer of neurons. What might be the issue?

Minimal code to reproduce problem

What you have aready tried

Expected output (if relevant)

Actual output (if relevant)

Full traceback of error (if relevant)


SyntaxError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/brian2/core/network.py in before_run(self, run_namespace)
896 try:
→ 897 obj.before_run(run_namespace)
898 except Exception as ex:

11 frames
SyntaxError: invalid syntax (, line 1)

The above exception was the direct cause of the following exception:

BrianObjectException Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/brian2/core/network.py in before_run(self, run_namespace)
897 obj.before_run(run_namespace)
898 except Exception as ex:
→ 899 raise BrianObjectException(“An error occurred when preparing an object.”, obj) from ex
900
901 # Check that no object has been run as part of another network before

BrianObjectException: Error encountered with object named “neurongroup_2_thresholder”.
Object was created here (most recent call only, full details in debug log):
File “”, line 1, in
neuron_groups[‘e’] = NeuronGroup(int(n_e_total), neuron_eqs_e, threshold=v_thresh_e_str, refractory=refrac_e, reset=scr_e, method=‘euler’)

An error occurred when preparing an object. (See above for original error message and traceback.)

I’m not sure exactly what’s going on, but some of the Brian1->Brian2 conversion notes might be useful to you:

here’s the landing page for that section

and here’s the section of the conversion docs that mentions the run function