JuliaIO / BSON.jl

Other
158 stars 39 forks source link

`ERROR: type Method has no field sparam_syms` when saving Flux Chain #54

Closed MaximeBouton closed 3 years ago

MaximeBouton commented 4 years ago

When saving a struct composed of Flux Chain object with anonymous function BSON returns the following error:

ERROR: type Method has no field sparam_syms

It seems to be due to the presence of anonymous function.

I am using Julia 1.2, BSON v2.3, Flux v0.8.3

The same code is working in Julia 1.1 (and same Flux and BSON version)

Here is a MWE:

using Flux
using BSON

model = Chain(Conv((5,), 1 => 32, relu, stride=5), 
             x -> view(x, :, :, :, :),
          x -> permutedims(x, (1, 2, 4, 3)),
          Conv((1,32), 1 => 32, relu),
          x -> reshape(x, (8, 32, :)),
          x -> maximum(x, dims=1), 
          x -> reshape(x, (32, :)))

bson("model.bson", model=model)

Thanks for your help

ararslan commented 4 years ago

This will be fixed by #37

DhairyaLGandhi commented 3 years ago

This is fixed already. Thanks all!