# Error running model-zoo example cifar10.jl of the Flux package

**URL:** https://discourse.julialang.org/t/error-running-model-zoo-example-cifar10-jl-of-the-flux-package/19991
**Category:** General Usage
**Tags:** flux
**Created:** [January 23, 2019, 3:59pm UTC](https://discourse.julialang.org/t/error-running-model-zoo-example-cifar10-jl-of-the-flux-package/19991 "2019-01-23T15:59:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![arnaudmgh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arnaudmgh/32/7134_2.png) [@arnaudmgh](https://discourse.julialang.org/u/arnaudmgh)
#### Post date: [January 23, 2019, 3:59pm UTC](https://discourse.julialang.org/t/error-running-model-zoo-example-cifar10-jl-of-the-flux-package/19991/1 "2019-01-23T15:59:57Z")

</div>

I tried with `]instantiate` first, and without, same result. Seems to be a problem with conversion to Float32 of Forward.Diff.Dual. Not sure how to go about it, any help would be appreciated.

```julia
julia> include("cifar10.jl")
ERROR: LoadError: MethodError: no method matching Float32(::ForwardDiff.Dual{Nothing,Float64,1})
Closest candidates are:
  Float32(::Real, ::RoundingMode) where T<:AbstractFloat at rounding.jl:185
  Float32(::T<:Number) where T<:Number at boot.jl:725
  Float32(::Int8) at float.jl:60
  ...
in expression starting at /Users/aamzallag/code_programming/julia/model-zoo/vision/cifar10/cifar10.jl:122

```

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [January 23, 2019, 4:08pm UTC](https://discourse.julialang.org/t/error-running-model-zoo-example-cifar10-jl-of-the-flux-package/19991/2 "2019-01-23T16:08:28Z")

</div>

Maybe fixed by [conversions for dual numbers · FluxML/Flux.jl@152ce4a · GitHub](https://github.com/FluxML/Flux.jl/commit/152ce4a164a4602bf8804090e79b1ca59772f70c).

Try use Flux master?

---

<div class="post-metadata">

### Author: ![arnaudmgh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arnaudmgh/32/7134_2.png) [@arnaudmgh](https://discourse.julialang.org/u/arnaudmgh)
#### Post date: [January 23, 2019, 4:17pm UTC](https://discourse.julialang.org/t/error-running-model-zoo-example-cifar10-jl-of-the-flux-package/19991/3 "2019-01-23T16:17:09Z")

</div>

Thank you! I am trying that (cifar10.jl takes a few minutes to run).

Quick question: I did `]add Flux#master` (activated project is `cifar10`). Is it the right way to do it? Does it modifies the Manifest.toml so that it will always use this git commit?

---

<div class="post-metadata">

### Author: ![arnaudmgh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arnaudmgh/32/7134_2.png) [@arnaudmgh](https://discourse.julialang.org/u/arnaudmgh)
#### Post date: [January 23, 2019, 4:34pm UTC](https://discourse.julialang.org/t/error-running-model-zoo-example-cifar10-jl-of-the-flux-package/19991/4 "2019-01-23T16:34:51Z")

</div>

Unfortunately that did not work:

```julia
(cifar10) pkg> add Flux#master
   Cloning git-repo `https://github.com/FluxML/Flux.jl.git`
  Updating git-repo `https://github.com/FluxML/Flux.jl.git`
 Resolving package versions...
  Updating `~/code_programming/julia/model-zoo/vision/cifar10/Project.toml`
  [587475ba] ↑ Flux v0.7.1 ⇒ v0.7.1+ #master (https://github.com/FluxML/Flux.jl.git)
  Updating `~/code_programming/julia/model-zoo/vision/cifar10/Manifest.toml`
  [587475ba] ↑ Flux v0.7.1 ⇒ v0.7.1+ #master (https://github.com/FluxML/Flux.jl.git)

julia> include("cifar10.jl")
ERROR: LoadError: MethodError: no method matching Float32(::ForwardDiff.Dual{Nothing,Float64,1})
Closest candidates are:
  Float32(::Real, ::RoundingMode) where T<:AbstractFloat at rounding.jl:185
  Float32(::T<:Number) where T<:Number at boot.jl:725
  Float32(::Int8) at float.jl:60
  ...
in expression starting at /Users/aamzallag/code_programming/julia/model-zoo/vision/cifar10/cifar10.jl:122

```

line 122 where is fails is:

```julia
Flux.train!(loss, params(m), train, opt, cb = evalcb)

```

I don’t know how to go from there, to find where in the function calls the error happens…
