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 get a method error when trying to load the following model (error on the BSON.load line). I think its due to the reshape/unsqueeze.
Not sure if its a flux.jl issue or a BSON.jl issue or an error on my part.
Is there a way to properly save/load models with reshape/unsqueeze functions?
using Flux
using BSON
Generator_Conv(input_dim::Int, hidden_dim::Int,latent_dim::Int) =
Chain(
Dense(input_dim, hidden_dim),
BatchNorm(hidden_dim),
#x->Flux.reshape(x,hidden_dim,1,:), #either reshape/unsqueeze triggers it
x->Flux.unsqueeze(x,2),
)
function test()
gen = Generator_Conv(10,10,10) |> cpu
BSON.@save "test.bson" gen
#gen = BSON.load(joinpath(@__DIR__,"test.bson"),@__MODULE__)[:gen]
gen = BSON.load("test.bson")[:gen]
a = rand(10,10)
gen(a)
end
test()
Running on Julia 1.6, BSON v0.3.3, Flux v0.12.6
The text was updated successfully, but these errors were encountered:
I get a method error when trying to load the following model (error on the BSON.load line). I think its due to the reshape/unsqueeze.
Not sure if its a flux.jl issue or a BSON.jl issue or an error on my part.
Is there a way to properly save/load models with reshape/unsqueeze functions?
Running on Julia 1.6, BSON v0.3.3, Flux v0.12.6
The text was updated successfully, but these errors were encountered: