# Synapse function error message

**URL:** <https://brian.discourse.group/t/synapse-function-error-message/588>\
**Category:** Support\
**Tags:** synapses\
**Created:** [21 January 2022 00:12 UTC](https://brian.discourse.group/t/synapse-function-error-message/588 "2022-01-21T00:12:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lann591](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@lann591](https://brian.discourse.group/u/lann591)\
**Post date:** [21 January 2022 00:12 UTC](https://brian.discourse.group/t/synapse-function-error-message/588/1 "2022-01-21T00:12:08Z")

</div>

# Description of problem

I was having problems adding synapses into a neural network I am working on. So, I went back to the tutorials on brian2 website to see if I was missing something, I didn’t see anything different so I ran the code from the synapse tutorial page, and I got the same error message: “ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject”

Not sure what this means.

# Minimal code to reproduce problem

S = Synapses(G, G, on\_pre=‘v\_post += 0.2’)  
This is the line of code which is apparently producing that error message.

# What you have aready tried

Checked the lengths of the arrays to see if they match (they do), not sure what else I can do, this line of code is off the brian2 tutorial page too.  
Any help greatly appreciated!

# Expected output (if relevant)

# Actual output (if relevant)

# Full traceback of error (if relevant)

---

<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:** [21 January 2022 19:22 UTC](https://brian.discourse.group/t/synapse-function-error-message/588/2 "2022-01-21T19:22:53Z")

</div>

Hi Lann,

I think this error has to do with your brian install rather than any specific code.  
Check out Marcel’s solution in this other thread:

> [@Error numpy.ndarray size changed, may indicate binary incompatibility, Tutorial part 2](https://brian.discourse.group/t/error-numpy-ndarray-size-changed-may-indicate-binary-incompatibility-tutorial-part-2/400/2):
>
> This situtation can arise when you do non-default installations and update packages. From your error, it seems you have an installed version of Brian, and one in the directory where you run the code (brian2/synapses/...). Concretely, if I’m not mistaken, at some point our Cython implementation of the SpikeQueue mechanism was compiled (which happens automatically when you run pip install for example), and at a later point numpy was downgraded so that is no longer binary-compatible with the numpy …

-Adam

---

<div class="post-metadata">

**Author:** ![mstimberg](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/mstimberg/32/11_2.png) [@mstimberg](https://brian.discourse.group/u/mstimberg)\
**Post date:** [26 January 2022 10:50 UTC](https://brian.discourse.group/t/synapse-function-error-message/588/3 "2022-01-26T10:50:26Z")

</div>

Hi @lann591 , it actually turns out there was a bug in the Python wheel (the file used for install if you use `pip`) which made it incompatible with numpy versions \< 1.22. If you used `pip` to install brian2, and your numpy version is not the most recent one, this would explain your error. In that case, you can use one of the two workarounds I posted on this [github issue](https://github.com/brian-team/brian2/issues/1382#issuecomment-1022080543).
