TypeError: make_step() takes 5 positional arguments but 6 were given

The following error occurs when I run the example in nengo_ocl. How to solve this error?thank you!

from __future__ import print_function

import os

import nengo
# import nengo_ocl
import numpy as np

from nengo_extras.data import load_cifar10
from nengo_extras.cuda_convnet import CudaConvnetNetwork, load_model_pickle
from nengo_extras.gui import image_display_function

# Parameters
run_in_theano = False
use_ocl = True
n_presentations = 100
presentation_time = 0.2

(X_train, y_train), (X_test, y_test), label_names = (
    load_cifar10(label_names=True))
X_train = X_train.reshape(-1, 3, 32, 32).astype('float32')
X_test = X_test.reshape(-1, 3, 32, 32).astype('float32')
n_classes = len(label_names)

# crop data
X_train = X_train[:, :, 4:-4, 4:-4]
X_test = X_test[:, :, 4:-4, 4:-4]

# subtract mean
data_mean = X_train.mean(axis=0)
X_train -= data_mean
X_test -= data_mean

# retrieve from https://figshare.com/s/49741f9e2d0d29f68871
cc_model = load_model_pickle('cifar10-lif-1628.pkl')

with nengo.Network() as model:
    u = nengo.Node(nengo.processes.PresentInput(X_test, presentation_time))
    ccnet = CudaConvnetNetwork(cc_model, synapse=nengo.synapses.Alpha(0.005))
    nengo.Connection(u, ccnet.input, synapse=None)

    input_p = nengo.Probe(u)
    output_p = nengo.Probe(ccnet.output)

    # --- image display
    image_shape = X_test.shape[1:]
    display_f = image_display_function(image_shape, scale=1, offset=data_mean)
    display_node = nengo.Node(display_f, size_in=u.size_out)
    nengo.Connection(u, display_node, synapse=None)

    # --- output spa display
    vocab_names = [s.upper().decode('utf-8') for s in label_names]
    vocab_vectors = np.eye(len(vocab_names))

    vocab = nengo.spa.Vocabulary(len(vocab_names))
    for name, vector in zip(vocab_names, vocab_vectors):
        vocab.add(name, vector)

    config = nengo.Config(nengo.Ensemble)
    config[nengo.Ensemble].neuron_type = nengo.Direct()
    with config:
        output = nengo.spa.State(
            len(vocab_names), subdimensions=10, vocab=vocab)
    nengo.Connection(ccnet.output, output.input)

if run_in_theano:
    os.environ['THEANO_FLAGS'] = 'device=gpu,floatX=float32'
    Q = ccnet.theano_compute(X_test[:n_presentations])
    Z = np.argmax(Q, axis=-1) == y_test[:n_presentations]
    print("ANN accuracy (%d examples): %0.4f" % (n_presentations, Z.mean()))

# Sim = nengo_ocl.Simulator if use_ocl else nengo.Simulator
#
# with Sim(model) as sim:
#     sim.run(n_presentations * presentation_time)

with nengo.Simulator(model) as sim:
    sim.run(n_presentations * presentation_time)

nt = int(presentation_time / sim.dt)
blocks = sim.data[output_p].reshape(n_presentations, nt, n_classes)
choices = np.argmax(blocks[:, -20:, :].mean(axis=1), axis=1)
accuracy = (choices == y_test[:n_presentations]).mean()
print('Spiking accuracy (%d examples): %0.3f' % (n_presentations, accuracy))
C:\Users\rgzn116\Anaconda3\envs\my_nengo\python.exe C:/Users/rgzn116/program/vision_classifier_test/ImageNet.py
C:\Users\rgzn116\Anaconda3\envs\my_nengo\lib\site-packages\nengo_extras\neurons.py:338: UserWarning: numba not installed, NumbaLIF will not be available.
  warnings.warn("numba not installed, NumbaLIF will not be available.")
Build finished in 0:00:02.                                                      
Traceback (most recent call last):
  File "C:/Users/rgzn116/program/vision_classifier_test/ImageNet.py", line 77, in <module>
    with nengo.Simulator(model) as sim:
  File "C:\Users\rgzn116\Anaconda3\envs\my_nengo\lib\site-packages\nengo\simulator.py", line 198, in __init__
    self.reset(seed=seed)
  File "C:\Users\rgzn116\Anaconda3\envs\my_nengo\lib\site-packages\nengo\simulator.py", line 333, in reset
    op.make_step(self.signals, self.dt, self.rng) for op in self._step_order
  File "C:\Users\rgzn116\Anaconda3\envs\my_nengo\lib\site-packages\nengo\simulator.py", line 333, in <listcomp>
    op.make_step(self.signals, self.dt, self.rng) for op in self._step_order
  File "C:\Users\rgzn116\Anaconda3\envs\my_nengo\lib\site-packages\nengo\builder\processes.py", line 112, in make_step
    step_f = self.process.make_step(shape_in, shape_out, dt, rng, state)
TypeError: make_step() takes 5 positional arguments but 6 were given

Process finished with exit code 1

Hi @mingchenliu, and welcome to the Nengo forums!

It sounds like you have a version mismatch between NengoOCL, and Nengo. Can you provide the versions of each of these, so that I can look into this further? You can get the version number of the packages installed in your environment by doing this in Python:

import nengo
import nengo_ocl
print(nengo.__version__)
print(nengo_ocl.__version__)

If you have any other Nengo packages installed, it would be helpful to get the version numbers for those to. :slight_smile: