Make LMU run in nengo_loihi


I was trying to implement this example: into nengo_loihi. I also referenced this example: However, I kept getting this error:
BuildError: No neurons marked for execution on-chip. Please mark some ensembles as on-chip.

So can I ask what is the appropriate way to write the lmu_psmnist with nengo_loihi?
Here is the stacktrace:
BuildError Traceback (most recent call last)
1 n_presentations = 50
----> 2 with nengo_loihi.Simulator(net, dt=dt, precompute=False) as sim:
3 # if running on Loihi, increase the max input spikes per step
4 if ‘loihi’ in sim.sims:
5 sim.sims[‘loihi’].snip_max_spikes_per_step = 120

~/nengo-loihi/nengo_loihi/ in init(self, network, dt, seed, model, precompute, target, progress_bar, remove_passthrough, hardware_options)
137 precompute=precompute,
138 remove_passthrough=remove_passthrough,
–> 139 discretize=target != “simreal”,
140 )

~/nengo-loihi/nengo_loihi/builder/ in build(self, obj, *args, **kwargs)
221 add_params(obj)
–> 223 built =, obj, *args, **kwargs)
224 if self.build_callback is not None:
225 self.build_callback(obj)

~/nxsdk09/lib/python3.5/site-packages/nengo/builder/ in build(cls, model, obj, *args, **kwargs)
237 for obj_cls in type(obj).mro:
238 if obj_cls in
–> 239 return[obj_cls](model, obj, *args, **kwargs)
241 raise BuildError(“Cannot build object of type %r” % type(obj).name)

~/nengo-loihi/nengo_loihi/builder/ in build_network(model, network, precompute, remove_passthrough, discretize)
46 discretize_model(model)
—> 48 validate_model(model)

~/nengo-loihi/nengo_loihi/builder/ in validate_model(model)
15 if len(model.blocks) == 0:
16 raise BuildError(
—> 17 "No neurons marked for execution on-chip. "
18 “Please mark some ensembles as on-chip.”
19 )

BuildError: No neurons marked for execution on-chip. Please mark some ensembles as on-chip.



The error you are encountering is displayed when the NengoLoihi builder cannot find any ensembles to run on the Loihi chip. It’s hard to say exactly why the error is being thrown without looking at the code itself, but if you are using the NengoDL LMU code example verbatim, this error is likely because NengoDL implements the LMUCell as a TensorFlow layer (which is not automatically translated to an object that can run on the Loihi board).

If you do want to create an LMU network with NengoLoihi, we have an example of this here:

Thanks for your reply.

Later I replaced the lmu object with an ensembleArray. It then partially works, but still needs a lot of tweaking.

Yes, I have tried the nengo_loihi example you mentioned. But it seems more difficult to build upon it than the example I used.