What wrong ? ERROR: UndefVarError: Gray not defined

julia> imagestrip(image::Matrix{<:Gray}) = Float32.(reshape(image, :))
ERROR: UndefVarError: Gray not defined
Stacktrace:
 [1] top-level scope
   @ REPL[43]:1

All code :Recognize Handwriting Using an Artificial Neural Network | by Erik Engheim | Better Programming
Paul

It is missing the type Gray which the Plots.jl package will export for you. I see that using Plots is ran later in the tutorial so it is likely that the author just missed that it needed to be imported early and wanted to make it more pedagogical by importing it later when they did plotting.

But if you add a using Plots with the other using statements before the presented line, it should hopefully work fine.

EDIT:
I found that Flux.Data.MNIST also contains a const Gray = Colors.Gray{Colors.N0f8}. This is probably the one that should be used, not sure why it seems like it was exported in the tuturial but not now. You can import it by

using Flux.Data.MNIST: Gray
# As before
using Flux, Flux.Data.MNIST, Statistics
using Flux: onehotbatch, onecold, crossentropy, throttle
using Base.Iterators: repeated
...