Model weights dense

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


asking Julia for help

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?

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

Thanks. Can’t reproduce:

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

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.

1 Like

Thank You