Flux cannot save a parameters

Dear Julia community,

I am trying to save parameters for trained RNN with BSON. However it seems that in latest version of FLUX this is not possible, however https://fluxml.ai says something different.
I create rnn as:
rnn = Chain(LSTM(12, 128), LSTM(128, 10), Dense(10, 1, relu))

then, create a parameters:
ps = params(rnn)

then trying to save parameters:
@save “param.BSON” ps

Here I get an error:
julia> @save “param.BSON” ps
ERROR: UndefRefError: access to undefined reference

Anybody has an idea how to get out of this?

Julia Version 1.2.0
BSON v0.2.4
Flux v0.10.0

1 Like

Have you try saving the result of data.(ps)? Though data is said to be deprecated, so It effectively seems like the docs needs an update!

Why not just save the model?

julia> @save "model.bson" rnn

This is exactly what I was looking for, thanks.