Nengo convolution error


#1

Hi all,
I tried to run the Convolutional Networks example in the NengoLoihi and this error is issued
AttributeError: module ‘nengo’ has no attribute ‘convolution’. What the lib did I miss? I already installed nengo, nengo_dl and nengo_loihi … Thank you

----code----
def conv_layer(x, *args, activation=True, **kwargs):
# create a Conv2D transform with the given arguments
conv = nengo.Convolution(*args, channels_last=False, **kwargs)

if activation:
    # add an ensemble to implement the activation function
    layer = nengo.Ensemble(conv.output_shape.size, 1).neurons
else:
    # no nonlinearity, so we just use a node
    layer = nengo.Node(size_in=conv.output_shape.size)

# connect up the input object to the new layer
nengo.Connection(x, layer, transform=conv)

# print out the shape information for our new layer
print("LAYER")
print(conv.input_shape.shape, "->", conv.output_shape.shape)

return layer, conv

—end code—
The error is
— error–
AttributeError Traceback (most recent call last)
in ()
27 # build parallel copies of the network
28 for _ in range(n_parallel):
—> 29 layer, conv = conv_layer(inp, 1, input_shape, kernel_size=(1, 1), init=np.ones((1,1,1,1)))
30 # first layer is off-chip to translate the images into spikes
31 net.config[layer.ensemble].on_chip = False

in conv_layer(x, activation, *args, **kwargs)
1 def conv_layer(x, *args, activation=True, **kwargs):
2 # create a Conv2D transform with the given arguments
----> 3 conv = nengo.convolution(*args, channels_last=False, **kwargs)
4
5 if activation:

AttributeError: module ‘nengo’ has no attribute ‘convolution’
— end error----


#2

The nengo.Convolution class is new, and not yet released. To use it, you need to install the development version of Nengo. The easiest way to do this is

pip uninstall nengo
pip install git+https://github.com/nengo/nengo.git

#3

Oh I see, thank you