Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signal dict KeyError when displaying voltage plots with a model containing more than one ensemble #1034

Open
xchoo opened this issue Dec 30, 2020 · 1 comment

Comments

@xchoo
Copy link
Member

xchoo commented Dec 30, 2020

Describe the bug

If you try to display the voltage plot with a network containing more than one ensemble, the following error is produced intermittently. Sometimes spamming the play button fixes it.

Traceback (most recent call last):
  File "/home/xchoo/miniconda3/envs/test2/lib/python3.8/site-packages/nengo/builder/signal.py", line 261, in __getitem__
    return dict.__getitem__(self, key)
KeyError: Signal(<Neurons of <Ensemble (unlabeled) at 0x7f44d417a640>>.voltage[(slice(None, 5, None),)], shape=(5,))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/xchoo/miniconda3/envs/test2/lib/python3.8/site-packages/nengo_gui/page.py", line 526, in runner
    self.sim.step()
  File "/home/xchoo/miniconda3/envs/test2/lib/python3.8/site-packages/nengo/simulator.py", line 353, in step
    self._probe()
  File "/home/xchoo/miniconda3/envs/test2/lib/python3.8/site-packages/nengo/simulator.py", line 239, in _probe
    tmp = self.signals[self.model.sig[probe]['in']].copy()
  File "/home/xchoo/miniconda3/envs/test2/lib/python3.8/site-packages/nengo/builder/signal.py", line 265, in __getitem__
    base = dict.__getitem__(self, key.base)
KeyError: Signal(<Neurons of <Ensemble (unlabeled) at 0x7f44d417a640>>.voltage, shape=(100,))

To reproduce

Steps to reproduce the behavior:

  1. Load the "communication_channel" basic example
  2. Pull up the voltage plot for any of the ensembles
  3. Push the play button
  4. Error is produced

Expected behavior

An error should not be produced.

Screenshots

If applicable, add screenshots to help explain your problem.

Versions

  • OS: Ubuntu 20.04
  • Browser: Chrome
  • Python: 3.5.2 (replicated with Python 3.8.0)
  • Nengo GUI: 0.4.7
  • Other: Nengo 3.0.0 (but replicated with Nengo 2.8.0, 2.7.0)

Additional context

It seems like it might be a threading issue, where the GUI is trying to get a handle on the signal before it is created? Or maybe an ordered dict issue? One oddity is that if you pull up another plot with the voltage plot, the probability of the error occurring goes down.

@FilipDepta
Copy link

FilipDepta commented Feb 15, 2021

Switching to another backend (tested with Nengo OCL) results in not producing an error.

Versions

  • OS: Windows 10 (2004)
  • Browser: Chrome
  • Python: 3.7.6
  • Nengo: 3.0.0
  • Nengo GUI: 0.4.7
  • Nengo OCL: 2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants