Installed Flux has wrong types

I installed Flux v0.10.0 and tried the example

> d = Dense(5, 2)
> d(rand(5))

and got

2-element Array{Float32,1}:
 -0.30700117
 -0.7389947

Instead of

Tracked 2-element Array{Float64,1}:
  0.00257447
  -0.00449443

Consequently, there is no gradient:

> d.W.grad
ERROR: type Array has no field grad

Might be relevant: there is an error in the installation of Flux, probably because I’m using Windows:

julia> Pkg.build("Flux")
  Building ZipFile ─────────→ `C:\Users\DeadScholar\.julia\packages\ZipFile\oD4uG\deps\build.log`
  Building CodecZlib ───────→ `C:\Users\DeadScholar\.julia\packages\CodecZlib\5t9zO\deps\build.log`
  Building NNlib ───────────→ `C:\Users\DeadScholar\.julia\packages\NNlib\Nksco\deps\build.log`
ā”Œ Error: Error building `NNlib`:
│ ā”Œ Warning: Your platform ("x86_64-w64-mingw32", parsed as "x86_64-w64-mingw32-gcc7-cxx11") is not supported by NNPACK!
│ │           You will only be able to use only the default NNlib backend.
│ ā”” @ Main C:\Users\DeadScholar\.julia\packages\NNlib\Nksco\deps\build.jl:30
│ ERROR: LoadError: MethodError: no method matching iterate(::Nothing)
│ Closest candidates are:
│   iterate(!Matched::Core.SimpleVector) at essentials.jl:600
│   iterate(!Matched::Core.SimpleVector, !Matched::Any) at essentials.jl:600
│   iterate(!Matched::ExponentialBackOff) at error.jl:218
│   ...
│ Stacktrace:
│  [1] top-level scope at C:\Users\DeadScholar\.julia\packages\NNlib\Nksco\deps\build.jl:38
│  [2] include at .\boot.jl:328 [inlined]
│  [3] include_relative(::Module, ::String) at .\loading.jl:1105
│  [4] include(::Module, ::String) at .\Base.jl:31
│  [5] include(::String) at .\client.jl:424
│  [6] top-level scope at none:5
│ in expression starting at C:\Users\DeadScholar\.julia\packages\NNlib\Nksco\deps\build.jl:36
ā”” @ Pkg.Operations D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\backwards_compatible_isolation.jl:649
  Building FFTW ────────────→ `C:\Users\DeadScholar\.julia\packages\FFTW\qqcBj\deps\build.log`
  Building SpecialFunctions → `C:\Users\DeadScholar\.julia\packages\SpecialFunctions\ne2iw\deps\build.log`
false

Version 0.10 of Flux uses the new AD Zygote.jl instead of trackers, so you will never see tracked arrays in new Flux.

Try Flux.gradient(d,x) instead.

2 Likes