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