# BrianObjectException: Error encountered with object named "neurongroup\_thresholder"

**URL:** <https://brian.discourse.group/t/brianobjectexception-error-encountered-with-object-named-neurongroup-thresholder/428>\
**Category:** Support\
**Created:** [16 July 2021 17:42 UTC](https://brian.discourse.group/t/brianobjectexception-error-encountered-with-object-named-neurongroup-thresholder/428 "2021-07-16T17:42:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![snc](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@snc](https://brian.discourse.group/u/snc)\
**Post date:** [16 July 2021 17:42 UTC](https://brian.discourse.group/t/brianobjectexception-error-encountered-with-object-named-neurongroup-thresholder/428/1 "2021-07-16T17:42:47Z")

</div>

# 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.)

---

<div class="post-metadata">

**Author:** ![adam](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/adam/32/197_2.png) [@adam](https://brian.discourse.group/u/adam)\
**Post date:** [19 July 2021 13:49 UTC](https://brian.discourse.group/t/brianobjectexception-error-encountered-with-object-named-neurongroup-thresholder/428/2 "2021-07-19T13:49:05Z")

</div>

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](https://brian2.readthedocs.io/en/stable/introduction/changes.html)

and [here’s the section of the conversion docs that mentions the run function](https://brian2.readthedocs.io/en/stable/introduction/brian1_to_2/networks_and_clocks.html)
