# Error in Flux v0.10.0 tutorial

**URL:** https://discourse.julialang.org/t/error-in-flux-v0-10-0-tutorial/32595
**Category:** New to Julia
**Created:** [December 23, 2019, 12:48am UTC](https://discourse.julialang.org/t/error-in-flux-v0-10-0-tutorial/32595 "2019-12-23T00:48:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![yuxi.liu](https://avatars.discourse-cdn.com/v4/letter/y/839c29/32.png) [@yuxi.liu](https://discourse.julialang.org/u/yuxi.liu)
#### Post date: [December 23, 2019, 12:48am UTC](https://discourse.julialang.org/t/error-in-flux-v0-10-0-tutorial/32595/1 "2019-12-23T00:48:46Z")

</div>

I’m trying the Flux tutorial [Basics · Flux](https://fluxml.ai/Flux.jl/stable/models/basics/) and got weird error:

```julia
using Flux
W = rand(2, 5)
b = rand(2)
predict(x) = W*x .+ bfunction loss(x, y)
ŷ = predict(x)
sum((y .- ŷ).^2)
endx, y = rand(5), rand(2)gs = gradient(() -> loss(x, y), params(W, b))
W̄ = gs[W]

```

`ERROR: KeyError: key [0.6494686402869012 0.16642755891498795 … 0.3477631878161558 0.7117085219963473; 0.924010195090909 0.7238725578121123 … 0.25837956485675106 0.15091689039220757] not found`

How to make it return the right thing?

---

<div class="post-metadata">

### Author: ![bocc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bocc/32/7546_2.png) [@bocc](https://discourse.julialang.org/u/bocc)
#### Post date: [January 1, 2020, 7:59am UTC](https://discourse.julialang.org/t/error-in-flux-v0-10-0-tutorial/32595/2 "2020-01-01T07:59:40Z")

</div>

This code works for me (Julia 1.3, Flux 0.10). (After correcting the indentation of course.)
