You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use BSON in Flux to save/load my model, it works well when I save the origin model. But it failed when I save the model which load from file.
Below is the code, the last line failed.
using BSON: @save, @load
a=1
@save "a.bson" a
@load "a.bson" a
@save "a.bson" a # works well
using Flux
m = Dense(10, 5)
@save "m.bson" m # works well
@load "m.bson" m
@save "m.bson" m # TypeError: in Type, in parameter, expected Type, got Type{Vararg{Any,N} where N}
Stack trace:
Stacktrace:
[1] typeof_ at D:\julia\.julia\packages\BSON\kxdIr\src\write.jl:50 [inlined]
[2] _lower_recursive(::Type, ::IdDict{Any,Any}, ::Array{Any,1}) at D:\julia\.julia\packages\BSON\kx
dIr\src\write.jl:54
[3] (::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}})(::Type) at D:\julia\.julia\p
ackages\BSON\kxdIr\src\write.jl:62
[4] applychildren!(::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}}, ::Array{Any,1}
) at D:\julia\.julia\packages\BSON\kxdIr\src\BSON.jl:28
[5] _lower_recursive(::Array{UnionAll,1}, ::IdDict{Any,Any}, ::Array{Any,1}) at D:\julia\.julia\pac
kages\BSON\kxdIr\src\write.jl:62
[6] (::getfield(BSON, Symbol("##5#9")){IdDict{Any,Any},Array{Any,1}})(::Array{UnionAll,1}) at D:\ju
lia\.julia\packages\BSON\kxdIr\src\write.jl:53
[7] applychildren!(::getfield(BSON, Symbol("##5#9")){IdDict{Any,Any},Array{Any,1}}, ::Dict{Symbol,A
ny}) at D:\julia\.julia\packages\BSON\kxdIr\src\BSON.jl:21
[8] (::getfield(BSON, Symbol("#_lower#8")){IdDict{Any,Any},Array{Any,1}})(::Type) at D:\julia\.juli
a\packages\BSON\kxdIr\src\write.jl:53
[9] _lower_recursive(::Type, ::IdDict{Any,Any}, ::Array{Any,1}) at D:\julia\.julia\packages\BSON\kx
dIr\src\write.jl:54
[10] (::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}})(::Type) at D:\julia\.julia\
packages\BSON\kxdIr\src\write.jl:62
[11] applychildren!(::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}}, ::Array{Any,1
}) at D:\julia\.julia\packages\BSON\kxdIr\src\BSON.jl:28
[12] _lower_recursive(::Array{DataType,1}, ::IdDict{Any,Any}, ::Array{Any,1}) at D:\julia\.julia\pa
ckages\BSON\kxdIr\src\write.jl:62
[13] (::getfield(BSON, Symbol("##5#9")){IdDict{Any,Any},Array{Any,1}})(::Array{DataType,1}) at D:\j
ulia\.julia\packages\BSON\kxdIr\src\write.jl:53
[14] applychildren!(::getfield(BSON, Symbol("##5#9")){IdDict{Any,Any},Array{Any,1}}, ::Dict{Symbol,
Any}) at D:\julia\.julia\packages\BSON\kxdIr\src\BSON.jl:21
[15] (::getfield(BSON, Symbol("#_lower#8")){IdDict{Any,Any},Array{Any,1}})(::Type) at D:\julia\.jul
ia\packages\BSON\kxdIr\src\write.jl:53
[16] _lower_recursive(::Type, ::IdDict{Any,Any}, ::Array{Any,1}) at D:\julia\.julia\packages\BSON\k
xdIr\src\write.jl:54
[17] (::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}})(::Type) at D:\julia\.julia\
packages\BSON\kxdIr\src\write.jl:62
[18] applychildren!(::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}}, ::Dict{Symbol
,Any}) at D:\julia\.julia\packages\BSON\kxdIr\src\BSON.jl:21
[19] _lower_recursive(::Flux.Tracker.Call{Nothing,Tuple}, ::IdDict{Any,Any}, ::Array{Any,1}) at D:\
julia\.julia\packages\BSON\kxdIr\src\write.jl:62
[20] (::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}})(::Flux.Tracker.Call{Nothing
,Tuple}) at D:\julia\.julia\packages\BSON\kxdIr\src\write.jl:62
[21] applychildren!(::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}}, ::Array{Any,1
}) at D:\julia\.julia\packages\BSON\kxdIr\src\BSON.jl:28
[22] _lower_recursive(::Array{Any,1}, ::IdDict{Any,Any}, ::Array{Any,1}) at D:\julia\.julia\package
s\BSON\kxdIr\src\write.jl:62
[23] (::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}})(::Array{Any,1}) at D:\julia
\.julia\packages\BSON\kxdIr\src\write.jl:62
[24] applychildren!(::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}}, ::Dict{Symbol
,Any}) at D:\julia\.julia\packages\BSON\kxdIr\src\BSON.jl:21
[25] _lower_recursive(::Flux.Tracker.Tracked{Array{Float64,2}}, ::IdDict{Any,Any}, ::Array{Any,1})
at D:\julia\.julia\packages\BSON\kxdIr\src\write.jl:62
[26] (::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}})(::Flux.Tracker.Tracked{Arra
y{Float64,2}}) at D:\julia\.julia\packages\BSON\kxdIr\src\write.jl:62
[27] applychildren!(::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}}, ::Array{Any,1
}) at D:\julia\.julia\packages\BSON\kxdIr\src\BSON.jl:28
[28] _lower_recursive(::Array{Any,1}, ::IdDict{Any,Any}, ::Array{Any,1}) at D:\julia\.julia\package
s\BSON\kxdIr\src\write.jl:62
[29] (::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}})(::Array{Any,1}) at D:\julia
\.julia\packages\BSON\kxdIr\src\write.jl:62
[30] applychildren!(::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}}, ::Dict{Symbol
,Any}) at D:\julia\.julia\packages\BSON\kxdIr\src\BSON.jl:21
[31] _lower_recursive(::TrackedArray{…,Array{Float64,2}}, ::IdDict{Any,Any}, ::Array{Any,1}) at D:
\julia\.julia\packages\BSON\kxdIr\src\write.jl:62
[32] (::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}})(::TrackedArray{…,Array{Flo
at64,2}}) at D:\julia\.julia\packages\BSON\kxdIr\src\write.jl:62
[33] applychildren!(::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}}, ::Array{Any,1
}) at D:\julia\.julia\packages\BSON\kxdIr\src\BSON.jl:28
[34] _lower_recursive(::Array{Any,1}, ::IdDict{Any,Any}, ::Array{Any,1}) at D:\julia\.julia\package
s\BSON\kxdIr\src\write.jl:62
[35] (::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}})(::Array{Any,1}) at D:\julia
\.julia\packages\BSON\kxdIr\src\write.jl:62
[36] applychildren!(::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}}, ::Dict{Symbol
,Any}) at D:\julia\.julia\packages\BSON\kxdIr\src\BSON.jl:21
[37] _lower_recursive(::Dense{typeof(identity),TrackedArray{…,Array{Float64,2}},TrackedArray{…,Ar
ray{Float64,1}}}, ::IdDict{Any,Any}, ::Array{Any,1}) at D:\julia\.julia\packages\BSON\kxdIr\src\writ
e.jl:62
[38] (::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}})(::Dense{typeof(identity),Tr
ackedArray{…,Array{Float64,2}},TrackedArray{…,Array{Float64,1}}}) at D:\julia\.julia\packages\BSON
\kxdIr\src\write.jl:62
[39] applychildren!(::getfield(BSON, Symbol("##7#11")){IdDict{Any,Any},Array{Any,1}}, ::Dict{Symbol
,Any}) at D:\julia\.julia\packages\BSON\kxdIr\src\BSON.jl:21
[40] _lower_recursive(::Dict{Symbol,Dense{typeof(identity),TrackedArray{…,Array{Float64,2}},Tracke
dArray{…,Array{Float64,1}}}}, ::IdDict{Any,Any}, ::Array{Any,1}) at D:\julia\.julia\packages\BSON\k
xdIr\src\write.jl:62
[41] lower_recursive(::Dict{Symbol,Dense{typeof(identity),TrackedArray{…,Array{Float64,2}},Tracked
Array{…,Array{Float64,1}}}}) at D:\julia\.julia\packages\BSON\kxdIr\src\write.jl:73
[42] bson(::IOStream, ::Dict{Symbol,Dense{typeof(identity),TrackedArray{…,Array{Float64,2}},Tracke
dArray{…,Array{Float64,1}}}}) at D:\julia\.julia\packages\BSON\kxdIr\src\write.jl:81
[43] #14 at D:\julia\.julia\packages\BSON\kxdIr\src\write.jl:83 [inlined]
[44] #open#294(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function,
::getfield(BSON, Symbol("##14#15")){Dict{Symbol,Dense{typeof(identity),TrackedArray{…,Array{Float64
,2}},TrackedArray{…,Array{Float64,1}}}}}, ::String, ::Vararg{String,N} where N) at .\iostream.jl:36
9
[45] open at .\iostream.jl:367 [inlined]
[46] bson(::String, ::Dict{Symbol,Dense{typeof(identity),TrackedArray{…,Array{Float64,2}},TrackedA
rray{…,Array{Float64,1}}}}) at D:\julia\.julia\packages\BSON\kxdIr\src\write.jl:83
[47] top-level scope at none:0
The text was updated successfully, but these errors were encountered:
I use BSON in Flux to save/load my model, it works well when I save the origin model. But it failed when I save the model which load from file.
Below is the code, the last line failed.
Stack trace:
The text was updated successfully, but these errors were encountered: