nengo / nengo-loihi

Run Nengo models on Intel's Loihi chip
https://www.nengo.ai/nengo-loihi/
Other
35 stars 12 forks source link

Import errors for `nengo_loihi.conv` #186

Closed xchoo closed 5 years ago

xchoo commented 5 years ago

Importing conv from nengo_loihi (release 0.4.0) produces the following error:

Traceback (most recent call last):
  File "twolayer_model_onchip.accurate-fast.py", line 8, in <module>
    import nengo_loihi
  File "/home/xchoo/git/nengo-loihi-0.8/nengo_loihi/__init__.py", line 7, in <module>
    from . import builder
  File "/home/xchoo/git/nengo-loihi-0.8/nengo_loihi/builder.py", line 18, in <module>
    from nengo_loihi import conv
  File "/home/xchoo/git/nengo-loihi-0.8/nengo_loihi/conv.py", line 8, in <module>
    from nengo.builder.connection import BuiltConnection, get_samples, slice_signal
ImportError: cannot import name 'get_samples'

Looking at nengo.builder.connection there doesn't seem to be a get_samples. But there is one in nengo_loihi.builder.connection and in nengo.dists. Tracing the changes in nengo.builder.connection, get_samples seems to have been reworked into get_transform in this commit: https://github.com/nengo/nengo/commit/fcf43f43adeaae8b96a18a58a1a6e98e7bf1ceb1

drasmuss commented 5 years ago

The issue is that you're using the nengo development version, while nengo-loihi is only compatible with the latest nengo release (2.8.0). We may plan on supporting nengo development versions in the future, but for now the fix is to install nengo<=2.8.0. We'll also add a warning to make these compatibility issues more clear.

drasmuss commented 5 years ago

The latest nengo-loihi release (0.6.0) is now compatible with both nengo 2.8.0 and the development version. Our plan is to maintain compatibility with both the latest release and development version in the future (although as always with development versions there may be temporary incompatibilities).