Spinnaker - Error


I tried to run the example: nengo_spinnaker/learn_communication_channel.py at master · project-rig/nengo_spinnaker · GitHub
on SpiNNaker board

I got this error:

'nengo.builder.ensemble' has no attribute 'sample'

Can you help?

AttributeError Traceback (most recent call last) …\Spinnaker\Untitled-1.py in [42](file:///C:/Spinnaker/Untitled-1.py?line=41) if spinnaker**:** ----> [43](file:///C:/Spinnaker/Untitled-1.py?line=42) sim = nengo_spinnaker**.** Simulator**(** model**)** [44](file:///C:/Spinnaker/Untitled-1.py?line=43) else : [45](file:///C:/Spinnaker/Untitled-1.py?line=44) sim = nengo**.** Simulator**(** model**)** [46](file:///C:/Spinnaker/Untitled-1.py?line=45) ~\Anaconda3\lib\site-packages\nengo_spinnaker\simulator.py in init(self, network, dt, period, timescale, hostname, use_spalloc, allocation_fudge_factor) 112 self.model = Model(dt=dt, machine_timestep=machine_timestep, 113 decoder_cache=get_default_decoder_cache()) → 114 self**.** model**.** build**(** network**,** ****** builder_kwargs**)** 115 116 forced_removals = get_force_removal_passnodes**(** network**)** ~\Anaconda3\lib\site-packages\nengo_spinnaker\builder\builder.py in build**(self, network, kwargs) 203 # Build 204 with self**.** decoder_cache**:** → 205 self**.** _build_network**(** network**)** 206 207 def _build_network**(** self**,** network**)** : ~\Anaconda3\lib\site-packages\nengo_spinnaker\builder\builder.py in _build_network**(self, network)** 219 # Build all objects 220 for obj in itertools**.** chain**(** network**.** ensembles**,** network**.** nodes**)** : → 221 self**.** make_object**(** obj**)** 222 223 # Build all the connections ~\Anaconda3\lib\site-packages\nengo_spinnaker\builder\builder.py in make_object**(self, obj)** 233 “”" 234 self**.** seeds**[** obj**]** = get_seed**(** obj**,** self**.** rng**)** → 235 self**.** _builders**[** type**(** obj**)** ] ( self**,** obj**)** 236 237 def make_connection**(** self**,** conn**)** : ~\Anaconda3\lib\site-packages\nengo_spinnaker\builder\ensemble.py in build_ensemble**(model, ens)** 144 @ Model**.** builders**.** register**(** nengo**.** Ensemble**)** 145 def build_ensemble**(** model**,** ens**)** : → 146 ensemble_builders**[** type**(** ens**.** neuron_type**)** ] ( model**,** ens**)** 147 148 ~\Anaconda3\lib\site-packages\nengo_spinnaker\builder\ensemble.py in build_lif**(model, ens)** 164 165 # Get maximum rates and intercepts → 166 max_rates = ensemble**.** sample**(** ens**.** max_rates**,** ens**.** n_neurons**,** rng**=** rng**)** 167 intercepts = ensemble**.** sample**(** ens**.** intercepts**,** ens**.** n_neurons**,** rng**=** rng**)** 168 AttributeError : module ‘nengo.builder.ensemble’ has no attribute ‘sample’

Hi @hadarcd

I’m not sure of the exact cause of the error, but I would hazard a guess that it is due to an incompatibility between the versions of Nengo and NengoSpinnaker you have installed in your conda environment.
Can you post the output of conda list or pip freeze here?

As a note, NengoSpinnaker has only been tested to work with Nengo 2.2.0 at the latest. Since it is not under active development, it hasn’t been updated to work with the latest versions of Nengo.


I downgraded to 2.2.0, and it works

Awesome! :smiley: