# Model weights dense

**URL:** https://discourse.julialang.org/t/model-weights-dense/74349
**Category:** General Usage
**Tags:** question, flux
**Created:** [January 10, 2022, 7:08pm UTC](https://discourse.julialang.org/t/model-weights-dense/74349 "2022-01-10T19:08:30Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Sumanth](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@Sumanth](https://discourse.julialang.org/u/Sumanth)
#### Post date: [January 10, 2022, 7:08pm UTC](https://discourse.julialang.org/t/model-weights-dense/74349/1 "2022-01-10T19:08:30Z")

</div>

Error : type Dense has no field weight, What is going wrong?

---

<div class="post-metadata">

### Author: ![goerch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerch/32/29122_2.png) [@goerch](https://discourse.julialang.org/u/goerch)
#### Post date: [January 10, 2022, 9:21pm UTC](https://discourse.julialang.org/t/model-weights-dense/74349/2 "2022-01-10T21:21:05Z")

</div>

Hi,

asking Julia for help

```julia
help?> Dense
search: DenseArray DenseVector DenseMatrix DenseVecOrMat DimensionMismatch codeunits ncodeunits

Couldn't find Dense
Perhaps you meant else, Dims, Docs, end, Base, Revise, ans, less, entr, revise, @enter, @enum, close, eps, esc, gensym, ifelse, keys, merge, one or parse    
  No documentation found.

  Binding Dense does not exist.

```

doesn’t turn up anything. Are you using any libraries?

---

<div class="post-metadata">

### Author: ![Sumanth](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@Sumanth](https://discourse.julialang.org/u/Sumanth)
#### Post date: [January 10, 2022, 9:22pm UTC](https://discourse.julialang.org/t/model-weights-dense/74349/3 "2022-01-10T21:22:38Z")

</div>

I am using flux.  
Model = Dense(2,2)  
Model.weight is giving me error

---

<div class="post-metadata">

### Author: ![goerch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerch/32/29122_2.png) [@goerch](https://discourse.julialang.org/u/goerch)
#### Post date: [January 10, 2022, 9:44pm UTC](https://discourse.julialang.org/t/model-weights-dense/74349/4 "2022-01-10T21:44:16Z")

</div>

Thanks. Can’t reproduce:

```julia
julia> using Flux

julia> model = Dense(2, 2)
Dense(2, 2) # 6 parameters

julia> fieldnames(Dense)
(:weight, :bias, :σ)

julia> model.weight
2×2 Matrix{Float32}:
 -1.11773 -0.392404
  0.720997 0.309949

```

---

<div class="post-metadata">

### Author: ![mcabbott](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcabbott/32/6603_2.png) [@mcabbott](https://discourse.julialang.org/u/mcabbott)
#### Post date: [January 10, 2022, 9:55pm UTC](https://discourse.julialang.org/t/model-weights-dense/74349/5 "2022-01-10T21:55:21Z")

</div>

You might be using a really old version of Flux, in which this field was called `W`. In which case you should probably upgrade, the current version is 0.12.8.

---

<div class="post-metadata">

### Author: ![Sumanth](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@Sumanth](https://discourse.julialang.org/u/Sumanth)
#### Post date: [January 10, 2022, 10:21pm UTC](https://discourse.julialang.org/t/model-weights-dense/74349/6 "2022-01-10T22:21:48Z")

</div>

Thank You
