Errors running nengo example CNN ciphar10 (part 2)

I’m getting the following errors on running the CNN cifar 10 example code from the website, after this line of code:
(thank you in advance)

# use rate neurons always by setting learning_phase_scope
with tf.keras.backend.learning_phase_scope(1), nengo_dl.Simulator(

I've added the following prints for better understanding:
Build finished in 0:00:00                                                      
Optimization finished in 0:00:00                                               
Construction finished in 0:00:01                                               
starting training...
y_keys:
['output_p', 'input-layer_p', 'conv-layer1_p', 'conv-layer2_p', 'conv-layer3_p', 'conv-layer4_p', 'conv-layer5_p', 'dense-layer_p']
Y type:
<class 'list'>
X type:
<class 'list'>
train X shape:
(50000, 32, 32, 3)
train t shape:
(50000, 10)

train X:
[[[[-0.9999385  -0.9961553  -0.9965244 ]
   [-0.99996924 -0.9987697  -0.9973856 ]
   [-0.9996617  -0.9969858  -0.99701655]
   ...
   [-0.9976932  -0.9997232  -0.9976932 ]
   [-0.9997232  -0.9976932  -0.9997232 ]
   [-0.9976932  -0.99990773 -0.9976932 ]]

  [[-0.9999385  -0.9976932  -0.99981546]
   [-0.9976932  -0.999877   -0.9976932 ]
   [-0.99990773 -0.9976932  -0.99981546]
   ...
   [-0.9976932  -0.99975395 -0.9976932 ]
   [-0.9999385  -0.9976932  -0.99996924]
   [-0.9976932  -0.99996924 -0.9976932 ]]

  [[-0.999877   -0.9976932  -0.9997232 ]
   [-0.9976932  -0.9997847  -0.9976932 ]
   [-0.99975395 -0.9976932  -0.9998462 ]
   ...
   [-0.9976932  -0.9997232  -0.9976932 ]
   [-0.99975395 -0.9976932  -0.99996924]
   [-0.9976932  -0.9997847  -0.9976932 ]]

  ...
train t:
[[0. 0. 0. ... 0. 0. 0.]
 [0. 0. 0. ... 0. 0. 1.]
 [0. 0. 0. ... 0. 0. 0.]
 ...
 [0. 0. 0. ... 0. 0. 0.]
 [0. 0. 0. ... 0. 0. 0.]
 [0. 0. 0. ... 0. 0. 0.]]

Constructing graph: build stage finished in 0:00:01      

the error output is:
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-12-9c9fe265cc41> in <module>
     99 
    100         for epoch in range(n_epochs):
--> 101             sim.fit(
    102                 train_data,
    103                 steps_per_epoch=steps_per_epoch,

~\anaconda3\lib\site-packages\nengo\utils\magic.py in __call__(self, *args, **kwargs)
    179                 return self.wrapper(wrapped, instance, args, kwargs)
    180             else:
--> 181                 return self.wrapper(self.__wrapped__, self.instance, args, kwargs)
    182         else:
    183             instance = getattr(self.__wrapped__, "__self__", None)

~\anaconda3\lib\site-packages\nengo_dl\simulator.py in require_open(wrapped, instance, args, kwargs)
     65         )
     66 
---> 67     return wrapped(*args, **kwargs)
     68 
     69 

~\anaconda3\lib\site-packages\nengo_dl\simulator.py in fit(self, x, y, n_steps, stateful, **kwargs)
    866                 kwargs["validation_data"] = (x_val, y_val, validation_data[2])
    867 
--> 868         return self._call_keras(
    869             "fit", x=x, y=y, n_steps=n_steps, stateful=stateful, **kwargs
    870         )

~\anaconda3\lib\site-packages\nengo\utils\magic.py in __call__(self, *args, **kwargs)
    179                 return self.wrapper(wrapped, instance, args, kwargs)
    180             else:
--> 181                 return self.wrapper(self.__wrapped__, self.instance, args, kwargs)
    182         else:
    183             instance = getattr(self.__wrapped__, "__self__", None)

~\anaconda3\lib\site-packages\nengo_dl\simulator.py in with_self(wrapped, instance, args, kwargs)
     48     try:
     49         with tf.device(instance.tensor_graph.device):
---> 50             output = wrapped(*args, **kwargs)
     51     finally:
     52         tf.keras.backend.set_floatx(keras_dtype)

~\anaconda3\lib\site-packages\nengo_dl\simulator.py in _call_keras(self, func_type, x, y, n_steps, stateful, **kwargs)
   1042             func_args = dict(x=x, y=y, **kwargs)
   1043 
-> 1044         outputs = getattr(self.keras_model, func_type)(**func_args)
   1045 
   1046         # update n_steps/time

~\anaconda3\lib\site-packages\tensorflow\python\keras\engine\training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, validation_batch_size, validation_freq, max_queue_size, workers, use_multiprocessing)
   1098                 _r=1):
   1099               callbacks.on_train_batch_begin(step)
-> 1100               tmp_logs = self.train_function(iterator)
   1101               if data_handler.should_sync:
   1102                 context.async_wait()

~\anaconda3\lib\site-packages\tensorflow\python\eager\def_function.py in __call__(self, *args, **kwds)
    826     tracing_count = self.experimental_get_tracing_count()
    827     with trace.Trace(self._name) as tm:
--> 828       result = self._call(*args, **kwds)
    829       compiler = "xla" if self._experimental_compile else "nonXla"
    830       new_tracing_count = self.experimental_get_tracing_count()

~\anaconda3\lib\site-packages\tensorflow\python\eager\def_function.py in _call(self, *args, **kwds)
    869       # This is the first call of __call__, so we have to initialize.
    870       initializers = []
--> 871       self._initialize(args, kwds, add_initializers_to=initializers)
    872     finally:
    873       # At this point we know that the initialization is complete (or less

~\anaconda3\lib\site-packages\tensorflow\python\eager\def_function.py in _initialize(self, args, kwds, add_initializers_to)
    723     self._graph_deleter = FunctionDeleter(self._lifted_initializer_graph)
    724     self._concrete_stateful_fn = (
--> 725         self._stateful_fn._get_concrete_function_internal_garbage_collected(  # pylint: disable=protected-access
    726             *args, **kwds))
    727 

~\anaconda3\lib\site-packages\tensorflow\python\eager\function.py in _get_concrete_function_internal_garbage_collected(self, *args, **kwargs)
   2967       args, kwargs = None, None
   2968     with self._lock:
-> 2969       graph_function, _ = self._maybe_define_function(args, kwargs)
   2970     return graph_function
   2971 

~\anaconda3\lib\site-packages\tensorflow\python\eager\function.py in _maybe_define_function(self, args, kwargs)
   3359 
   3360           self._function_cache.missed.add(call_context_key)
-> 3361           graph_function = self._create_graph_function(args, kwargs)
   3362           self._function_cache.primary[cache_key] = graph_function
   3363 

~\anaconda3\lib\site-packages\tensorflow\python\eager\function.py in _create_graph_function(self, args, kwargs, override_flat_arg_shapes)
   3194     arg_names = base_arg_names + missing_arg_names
   3195     graph_function = ConcreteFunction(
-> 3196         func_graph_module.func_graph_from_py_func(
   3197             self._name,
   3198             self._python_function,

~\anaconda3\lib\site-packages\tensorflow\python\framework\func_graph.py in func_graph_from_py_func(name, python_func, args, kwargs, signature, func_graph, autograph, autograph_options, add_control_dependencies, arg_names, op_return_value, collections, capture_by_value, override_flat_arg_shapes)
    988         _, original_func = tf_decorator.unwrap(python_func)
    989 
--> 990       func_outputs = python_func(*func_args, **func_kwargs)
    991 
    992       # invariant: `func_outputs` contains only Tensors, CompositeTensors,

~\anaconda3\lib\site-packages\tensorflow\python\eager\def_function.py in wrapped_fn(*args, **kwds)
    632             xla_context.Exit()
    633         else:
--> 634           out = weak_wrapped_fn().__wrapped__(*args, **kwds)
    635         return out
    636 

~\anaconda3\lib\site-packages\tensorflow\python\framework\func_graph.py in wrapper(*args, **kwargs)
    975           except Exception as e:  # pylint:disable=broad-except
    976             if hasattr(e, "ag_error_metadata"):
--> 977               raise e.ag_error_metadata.to_exception(e)
    978             else:
    979               raise

AttributeError: in user code:

    C:\Users\Aeon\anaconda3\lib\site-packages\tensorflow\python\keras\engine\training.py:805 train_function  *
        return step_function(self, iterator)
    C:\Users\Aeon\anaconda3\lib\site-packages\tensorflow\python\keras\engine\training.py:795 step_function  **
        outputs = model.distribute_strategy.run(run_step, args=(data,))
    C:\Users\Aeon\anaconda3\lib\site-packages\tensorflow\python\distribute\distribute_lib.py:1259 run
        return self._extended.call_for_each_replica(fn, args=args, kwargs=kwargs)
    C:\Users\Aeon\anaconda3\lib\site-packages\tensorflow\python\distribute\distribute_lib.py:2730 call_for_each_replica
        return self._call_for_each_replica(fn, args, kwargs)
    C:\Users\Aeon\anaconda3\lib\site-packages\tensorflow\python\distribute\distribute_lib.py:3417 _call_for_each_replica
        return fn(*args, **kwargs)
    C:\Users\Aeon\anaconda3\lib\site-packages\tensorflow\python\keras\engine\training.py:788 run_step  **
        outputs = model.train_step(data)
    C:\Users\Aeon\anaconda3\lib\site-packages\tensorflow\python\keras\engine\training.py:755 train_step
        loss = self.compiled_loss(
    C:\Users\Aeon\anaconda3\lib\site-packages\tensorflow\python\keras\engine\compile_utils.py:186 __call__
        self.build(y_pred)
    C:\Users\Aeon\anaconda3\lib\site-packages\tensorflow\python\keras\engine\compile_utils.py:139 build
        self._losses = nest.map_structure(self._get_loss_object, self._losses)
    C:\Users\Aeon\anaconda3\lib\site-packages\tensorflow\python\util\nest.py:659 map_structure
        structure[0], [func(*x) for x in entries],
    C:\Users\Aeon\anaconda3\lib\site-packages\tensorflow\python\util\nest.py:659 <listcomp>
        structure[0], [func(*x) for x in entries],
    C:\Users\Aeon\anaconda3\lib\site-packages\tensorflow\python\keras\engine\compile_utils.py:264 _get_loss_object
        loss_name = loss.__name__

    AttributeError: 'functools.partial' object has no attribute '__name__'

A post was merged into an existing topic: Errors running nengo example CNN ciphar10