from brian2 import *
duration = 100*ms
G = NeuronGroup(10, '''dv/dt = -v/tau : volt
tau : second''',
threshold='v > -50*mV',
reset='v = -70*mV',
method='linear')
G.v = -65*mV
# Create subgroups
G1 = G[:5]
G2 = G[5:]
G1.tau = 10*ms
G2.tau = 10*ms
S1=SpikeMonitor(G1)
S2=SpikeMonitor(G2)
run(duration)
The detailed error information is as following:
ERROR Brian 2 encountered an unexpected error. If you think this is bug in Brian 2, please report this issue either to the mailing list at <http://groups.google.com/group/brian-development/>, or to the issue tracker at <https://github.com/brian-team/brian2/issues>. Please include this file with debug information in your report: c:\users\jason\appdata\local\temp\brian_debug_omnwsa.log Additionally, you can also include a copy of the script that was run, available at: c:\users\jason\appdata\local\temp\brian_script_lhislv.py You can also include a copy of the redirected std stream outputs, available at c:\users\jason\appdata\local\temp\brian_stdout_50tkvh.log and c:\users\jason\appdata\local\temp\brian_stderr_lx4vvu.log Thanks! [brian2]
Traceback (most recent call last):
File "D:/HieraticalSNN/test2.py", line 17, in <module>
run(duration)
File "D:\Program Files (x86)\Python27\lib\site-packages\brian2\units\fundamentalunits.py", line 2428, in new_f
result = f(*args, **kwds)
File "D:\Program Files (x86)\Python27\lib\site-packages\brian2\core\magic.py", line 371, in run
namespace=namespace, profile=profile, level=2+level)
File "D:\Program Files (x86)\Python27\lib\site-packages\brian2\core\magic.py", line 231, in run
namespace=namespace, profile=profile, level=level+1)
File "D:\Program Files (x86)\Python27\lib\site-packages\brian2\core\base.py", line 278, in device_override_decorated_function
return func(*args, **kwds)
File "D:\Program Files (x86)\Python27\lib\site-packages\brian2\units\fundamentalunits.py", line 2428, in new_f
result = f(*args, **kwds)
File "D:\Program Files (x86)\Python27\lib\site-packages\brian2\core\network.py", line 842, in run
obj.run()
File "D:\Program Files (x86)\Python27\lib\site-packages\brian2\core\base.py", line 181, in run
codeobj()
File "D:\Program Files (x86)\Python27\lib\site-packages\brian2\codegen\codeobject.py", line 98, in __call__
return self.run()
File "D:\Program Files (x86)\Python27\lib\site-packages\brian2\codegen\runtime\numpy_rt\numpy_rt.py", line 131, in run
raise brian_object_exception(message, self.owner, exc)
BrianObjectException: Original error and traceback:
Traceback (most recent call last):
File "D:\Program Files (x86)\Python27\lib\site-packages\brian2\codegen\runtime\numpy_rt\numpy_rt.py", line 122, in run
exec self.compiled_code in self.namespace
File "(string)", line 30, in <module>
IndexError: index 5 is out of bounds for axis 1 with size 5
Error encountered with object named "spikemonitor".
Object was created here (most recent call only, full details in debug log):
File "D:/HieraticalSNN/test2.py", line 15, in <module>
S1=SpikeMonitor(G1)
An exception occured during the execution of code object spikemonitor_codeobject.
The error was raised in the following line:
_array_spikemonitor_count[_events - _source_start] += 1
IndexError: index 5 is out of bounds for axis 1 with size 5
(See above for original error message and traceback.)
Process finished with exit code 1
Hi,
thanks for reporting this issue, this seems to be a genuine bug :-/ It only affects the "numpy" code generation target, i.e. if Brian can use Cython then all should be fine. It'd be interesting to know why the compilation with weave fails as well (if you add " prefs.codegen.target = 'weave' " to your script, it should fail with an error message stating the name of the log file, that log file might be helpful). You get the warning because if you do not explicitly chose a code generation target, Brian will try first weave then cython, and finally numpy. If Cython works correctly, you can ignore the warning. To get rid of it, explicitly add
prefs.codegen.target = 'cython'
to the top of your script (after the import). You can find more information on all this in the docs: http://brian2.readthedocs.io/en/stable/user/computation.html
Oh, and a final note: the bug is apparently triggered by the use
of SpikeMonitor on subgroups -- this *should* of course work, but
in your specific example it is not necessary, you could have a
single SpikeMonitor recording from the full group, instead.
Best,
Marcel
-- http://www.facebook.com/briansimulator https://twitter.com/briansimulator New paper about Brian 2: Stimberg M, Goodman DFM, Benichoux V, Brette R (2014).Equation-oriented specification of neural models for simulations. Frontiers Neuroinf, doi: 10.3389/fninf.2014.00006. --- You received this message because you are subscribed to the Google Groups "Brian" group. To unsubscribe from this group and stop receiving emails from it, send an email to briansupport...@googlegroups.com. To post to this group, send email to brians...@googlegroups.com. Visit this group at https://groups.google.com/group/briansupport. For more options, visit https://groups.google.com/d/optout.