Skip to content

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

Description

@xchoo

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions