nengo-loihi icon indicating copy to clipboard operation
nengo-loihi copied to clipboard

workaround for BlockShape in nengo-loihi 0.10.0

Open monttj opened this issue 4 years ago • 1 comments

Hello,

I am trying to follow the example in this page: https://www.nengo.ai/nengo-loihi/examples/keras-to-loihi.html

When trying to change the shape using Blockshape (*), I am facing some error message (**) below. It seems that the version of nengo-loihi 0.10.0 does not have the function of BlockShape().

I am wondering if there is any workaround.

Thank you very much,

Taejeong

(*)

conv0_shape = conv0_layer.output_shape[1:]
net.config[
    nengo_converter.layers[conv0].ensemble
].block_shape = nengo_loihi.BlockShape((16, 16, 4), conv0_shape)

conv1_shape = conv1_layer.output_shape[1:]
net.config[
    nengo_converter.layers[conv1].ensemble
].block_shape = nengo_loihi.BlockShape((8, 8, 16), conv1_shape)

dense0_shape = dense0_layer.output_shape[1:]
net.config[
    nengo_converter.layers[dense0].ensemble
].block_shape = nengo_loihi.BlockShape((50,), dense0_shape)

(**)


AttributeError Traceback (most recent call last) in 3 net.config[ 4 nengo_converter.layers[conv0].ensemble ----> 5 ].block_shape = nengo_loihi.BlockShape((16, 16, 4), conv0_shape) 6 7 conv1_shape = conv1_layer.output_shape[1:]

AttributeError: module 'nengo_loihi' has no attribute 'BlockShape'

monttj avatar Nov 05 '20 17:11 monttj

Hi Taejeong,

Unfortunately, there's no workaround for block_shape in nengo-loihi 0.10.0. You'll have to use the development version of NengoLoihi. master branch should work with Nengo 3.0.0 and NxSDK <= 0.9.5. If you want to be bleeding-edge, you can try the nengomaster branch, which we haven't merged yet but is basically ready to go (it works with Nengo master branch and NxSDK up to 0.9.9).

Very soon we'll have a new release of Nengo (version 3.1.0), and then we'll do a release of NengoLoihi with the block_shape support.

hunse avatar Nov 06 '20 14:11 hunse