@ToucheSir
When I try to save-load Functors.fmapstructure(model)
using BSON, I get an error
ERROR: MethodError: Cannot `convert` an object of type Float64 to an object of type Vector{Any}
Closest candidates are:
convert(::Type{T}, ::LinearAlgebra.Factorization) where T<:AbstractArray at D:\Programs\Julia-1.8.2\share\julia\stdlib\v1.8\LinearAlgebra\src\factorization.jl:58
convert(::Type{T}, ::Union{OneHotArray{K, N, var"N+1", <:CUDA.CuArray{OneHot{K}, N}} where {K, N, var"N+1"}, Union{Base.LogicalIndex{Bool, <:OneHotArray{K, N, var"N+1", <:CUDA.CuArray{OneHot{K}, N}} where var"N+1"}, Base.ReinterpretArray{Bool, N, <:Any, <:Union{SubArray{<:Any, <:Any, var"#s14"}, var"#s14"}} where var"#s14"<:(OneHotArray{K, N, var"N+1", <:CUDA.CuArray{OneHot{K}, N}} where var"N+1"), Base.ReshapedArray{Bool, N, <:Union{Base.ReinterpretArray{<:Any, <:Any, <:Any, <:Union{SubArray{<:Any, <:Any, var"#s15"}, var"#s15"}}, SubArray{<:Any, <:Any, var"#s15"}, var"#s15"}} where var"#s15"<:(OneHotArray{K, N, var"N+1", <:CUDA.CuArray{OneHot{K}, N}} where var"N+1"), SubArray{Bool, N, <:Union{Base.ReinterpretArray{<:Any, <:Any, <:Any, <:Union{SubArray{<:Any, <:Any, var"#s16"}, var"#s16"}}, Base.ReshapedArray{<:Any, <:Any, <:Union{Base.ReinterpretArray{<:Any, <:Any, <:Any, <:Union{SubArray{<:Any, <:Any, var"#s16"}, var"#s16"}}, SubArray{<:Any, <:Any, var"#s16"}, var"#s16"}}, var"#s16"}} where var"#s16"<:(OneHotArray{K, N, var"N+1",
<:CUDA.CuArray{OneHot{K}, N}} where var"N+1"), LinearAlgebra.Adjoint{Bool, <:OneHotArray{K, N, var"N+1",
<:CUDA.CuArray{OneHot{K}, N}} where var"N+1"}, LinearAlgebra.Diagonal{Bool, <:OneHotArray{K, N, var"N+1", <:CUDA.CuArray{OneHot{K}, N}} where var"N+1"}, LinearAlgebra.LowerTriangular{Bool, <:OneHotArray{K, N, var"N+1", <:CUDA.CuArray{OneHot{K}, N}} where var"N+1"}, LinearAlgebra.Symmetric{Bool, <:OneHotArray{K, N, var"N+1", <:CUDA.CuArray{OneHot{K}, N}} where var"N+1"}, LinearAlgebra.Transpose{Bool, <:OneHotArray{K,
N, var"N+1", <:CUDA.CuArray{OneHot{K}, N}} where var"N+1"}, LinearAlgebra.Tridiagonal{Bool, <:OneHotArray{K, N, var"N+1", <:CUDA.CuArray{OneHot{K}, N}} where var"N+1"}, LinearAlgebra.UnitLowerTriangular{Bool, <:OneHotArray{K, N, var"N+1", <:CUDA.CuArray{OneHot{K}, N}} where var"N+1"}, LinearAlgebra.UnitUpperTriangular{Bool, <:OneHotArray{K, N, var"N+1", <:CUDA.CuArray{OneHot{K}, N}} where var"N+1"}, LinearAlgebra.UpperTriangular{Bool, <:OneHotArray{K, N, var"N+1", <:CUDA.CuArray{OneHot{K}, N}} where var"N+1"}, PermutedDimsArray{Bool, N, <:Any, <:Any, <:OneHotArray{K, N, var"N+1", <:CUDA.CuArray{OneHot{K}, N}} where var"N+1"}} where {K, N}}) where T<:Array at D:\.julia\packages\PrimitiveOneHot\M7M4C\src\gpu.jl:15
convert(::Type{T}, ::Union{Union{NNlib.BatchedAdjoint{T, <:CUDA.CuArray{T}}, NNlib.BatchedTranspose{T,
<:CUDA.CuArray{T}}} where T, Union{Base.LogicalIndex{T, <:Union{NNlib.BatchedAdjoint{T, <:CUDA.CuArray{T}}, NNlib.BatchedTranspose{T, <:CUDA.CuArray{T}}}}, Base.ReinterpretArray{T, N, <:Any, <:Union{SubArray{<:Any, <:Any, var"#s14"}, var"#s14"}} where var"#s14"<:Union{NNlib.BatchedAdjoint{T, <:CUDA.CuArray{T}}, NNlib.BatchedTranspose{T, <:CUDA.CuArray{T}}}, Base.ReshapedArray{T, N, <:Union{Base.ReinterpretArray{<:Any, <:Any, <:Any, <:Union{SubArray{<:Any, <:Any, var"#s15"}, var"#s15"}}, SubArray{<:Any, <:Any, var"#s15"}, var"#s15"}} where var"#s15"<:Union{NNlib.BatchedAdjoint{T, <:CUDA.CuArray{T}}, NNlib.BatchedTranspose{T, <:CUDA.CuArray{T}}}, SubArray{T, N, <:Union{Base.ReinterpretArray{<:Any, <:Any, <:Any, <:Union{SubArray{<:Any, <:Any, var"#s16"}, var"#s16"}}, Base.ReshapedArray{<:Any, <:Any, <:Union{Base.ReinterpretArray{<:Any, <:Any, <:Any, <:Union{SubArray{<:Any, <:Any, var"#s16"}, var"#s16"}}, SubArray{<:Any, <:Any, var"#s16"}, var"#s16"}}, var"#s16"}} where var"#s16"<:Union{NNlib.BatchedAdjoint{T, <:CUDA.CuArray{T}}, NNlib.BatchedTranspose{T, <:CUDA.CuArray{T}}}, LinearAlgebra.Adjoint{T, <:Union{NNlib.BatchedAdjoint{T, <:CUDA.CuArray{T}}, NNlib.BatchedTranspose{T, <:CUDA.CuArray{T}}}}, LinearAlgebra.Diagonal{T, <:Union{NNlib.BatchedAdjoint{T, <:CUDA.CuArray{T}}, NNlib.BatchedTranspose{T, <:CUDA.CuArray{T}}}}, LinearAlgebra.LowerTriangular{T, <:Union{NNlib.BatchedAdjoint{T, <:CUDA.CuArray{T}}, NNlib.BatchedTranspose{T, <:CUDA.CuArray{T}}}}, LinearAlgebra.Symmetric{T, <:Union{NNlib.BatchedAdjoint{T, <:CUDA.CuArray{T}}, NNlib.BatchedTranspose{T, <:CUDA.CuArray{T}}}}, LinearAlgebra.Transpose{T, <:Union{NNlib.BatchedAdjoint{T, <:CUDA.CuArray{T}}, NNlib.BatchedTranspose{T, <:CUDA.CuArray{T}}}}, LinearAlgebra.Tridiagonal{T, <:Union{NNlib.BatchedAdjoint{T, <:CUDA.CuArray{T}}, NNlib.BatchedTranspose{T, <:CUDA.CuArray{T}}}}, LinearAlgebra.UnitLowerTriangular{T, <:Union{NNlib.BatchedAdjoint{T, <:CUDA.CuArray{T}}, NNlib.BatchedTranspose{T, <:CUDA.CuArray{T}}}}, LinearAlgebra.UnitUpperTriangular{T, <:Union{NNlib.BatchedAdjoint{T, <:CUDA.CuArray{T}}, NNlib.BatchedTranspose{T, <:CUDA.CuArray{T}}}}, LinearAlgebra.UpperTriangular{T, <:Union{NNlib.BatchedAdjoint{T, <:CUDA.CuArray{T}}, NNlib.BatchedTranspose{T, <:CUDA.CuArray{T}}}}, PermutedDimsArray{T, N, <:Any, <:Any, <:Union{NNlib.BatchedAdjoint{T, <:CUDA.CuArray{T}}, NNlib.BatchedTranspose{T, <:CUDA.CuArray{T}}}}} where {T, N}}) where T<:Array at D:\.julia\packages\NNlibCUDA\kCpTE\src\batchedadjtrans.jl:15
...
Stacktrace:
[1] newstruct!(::IdDict{Any, Any}, ::Float64, ::Function, ::Bool)
@ BSON D:\.julia\packages\BSON\73cTU\src\extensions.jl:107
I convert my old model to cpu
using cpu(model)
as well as fmapstructure
.
I’ve also tried Serialization.jl, but it doesn’t work either.