CIFAR-10 LoiHi Example Deprecation Error Question

How do I fix?

I had the same issue!

Since it looks likes we are all three working on the same example file, Nengo Loihi - CIFAR-10 convolutional network, let me add my findings. I have created a non-gpu environment to run this example program. All goes well until I reach the 7th block of code where it evaluates the layers. When running the block I get 2 userWarnings: 1) tf.keras.backend.learning_phase_scope is deprecated, and 2) No GPU support detected. I expect to get the GPU warning since I’m running NengoLoihi and have not installed the cuda libraries, but I’m not sure how to update the deprecated tf.keras command.

The warning is telling me to update it, simply pass a True/False value to the training argument of the __call__ method of your layer or model. But I’m not exactly sure where to pass the T/F value.

So I guess my main question is: What is the current command I should be using to replace the deprecated tf.keras.backend.learning_phase_scope command?


nengo_dl has a command to help with this now: nengo_dl.configure_settings(learning_phase=True), used as part of your nengo.Network() creation.

I’ve put a fix here: Fixed functools.partial fix in Cifar10 notebook by xchoo · Pull Request #315 · nengo/nengo-loihi · GitHub

Thank you Eric! I will update the code on my end, run it again, and report back my success. Just to verify, since I’m still kind of new to Nengo, are you saying that “tf.keras.backend.learning_phase_scope(1)” should be replaced with the nengo_dl command of “nengo_dl.configure_settings(learning_phase=True)”?

Eric, thank you!