Errors running the new julialang.org blog post

Hello

I’m trying to run the code from the latest Julialang.org blog
Composability in Julia: Implementing Deep Equilibrium Models via Neural ODEs

Composability in Julia: Implementing Deep Equilibrium Models via Neural ODEs

21 October 2021 | Qiyao Wei, Frank Schäfer, Avik Pal, Chris Rackauckas

I’ve added the packages, pasted the code into VS Code and tried to run it.

The code gives me an error on the following lines:
Flux.train!(loss, Flux.params(deq), ((X, Y),), opt)
model, train_loader, test_loader = train(batchsize = 128, epochs = 1);

The error I get is for both lines:
Returns:ERROR: TypeError: non-boolean (Nothing) used in boolean context

Where do I start trying to resolve this? I can see 3 places to start:

  1. I’m making a newbie error with my Julia set up
  2. I’ve not got the right packages or package versions installed
  3. There is a typo in the code

If it is is the latter think it might have something to do with there being nothing after the comma here: ((X, Y),)

I’ve upgraded to 1.6.3 and updated all of my packages.
The last blog post with the fish animation worked ok.

Thanks

I am also getting this same error. My system is Julia 1.6.3 and Windows 10 without a GPU.

Since I have no GPU, the CUDA calls were removed throughout the script. The original script runs properly on Google Colab which has a GPU.

That line seems to work for me with a GPU, didn’t try on a cpu. There seemed to be a for loop statement missing for the plotting later, but otherwise it seemed fine.

I tried a many different variations of the line in question:
Flux.train!(loss, Flux.params(deq), ((X, Y),), opt)

It is either something with that line, or an incompatibility with the packages being used when you do not have a GPU.

@avikpal ?

Sorry, I should have said. I am also running Windows 10 without a GPU.