JuliaIO / JLD2.jl

HDF5-compatible file format in pure Julia
Other
534 stars 82 forks source link

Error on reading CategoricalArrays.CategoricalValue{String, UInt32} datatype #563

Closed mwsohn closed 1 week ago

mwsohn commented 1 week ago

I have the following error message on reading a jld2 file that contain a CategoricalArray whose original values were integers and their labels were strings:

┌ Warning: saved type CategoricalArrays.CategoricalValue{String, UInt32} is missing field ref in workspace type; reconstructing └ @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\data\reconstructing_datatypes.jl:207 ┌ Warning: type parameters for CategoricalArrays.CategoricalArray{Union{Missing, String},1,UInt32,String,JLD2.ReconstructedMutable{Symbol("CategoricalArrays.CategoricalValue{String, UInt32}"), (:level, :pool), Tuple{UInt32, Any}},Missing} do not match type CategoricalArrays.CategoricalArray in workspace; reconstructing └ @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\data\reconstructing_datatypes.jl:607 ┌ Warning: some parameters could not be resolved for type CategoricalArrays.CategoricalPool{String,UInt32,JLD2.ReconstructedMutable{Symbol("CategoricalArrays.CategoricalValue{String, UInt32}"), (:level, :pool), Tuple{UInt32, Any}}}; reconstructing └ @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\data\reconstructing_datatypes.jl:617 ERROR: StackOverflowError: Stacktrace: [1] eltype @ C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\JLD2.jl:150 [inlined] [2] eltype(::Type{Union{}}) @ Base .\abstractarray.jl:238 [inlined] [3] read_array(f::JLD2.JLDFile{…}, dataspace::JLD2.ReadDataspace, rr::JLD2.ReadRepresentation, layout::JLD2.DataLayout, filters::JLD2.FilterPipeline, header_offset::JLD2.RelOffset, attributes::Vector{…}) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\datasets.jl:397 [4] read_data(f::JLD2.JLDFile{…}, rr::JLD2.ReadRepresentation{…}, read_dataspace::Tuple{…}, attributes::Vector{…}) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\datasets.jl:276 [5] macro expansion @ C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\datasets.jl:224 [inlined]
[6] macro expansion @ C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\datatypes.jl:105 [inlined]
[7] read_data(f::JLD2.JLDFile{…}, dataspace::JLD2.ReadDataspace, datatype_class::UInt8, datatype_offset::Int64, layout::JLD2.DataLayout, filters::JLD2.FilterPipeline, header_offset::JLD2.RelOffset, attributes::Vector{…}) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\datasets.jl:211 [8] load_dataset(f::JLD2.JLDFile{JLD2.MmapIO}, offset::JLD2.RelOffset) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\datasets.jl:125 [9] jlconvert(::JLD2.ReadRepresentation{…}, f::JLD2.JLDFile{…}, ptr::Ptr{…}, ::JLD2.RelOffset) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\data\writing_datatypes.jl:314 [10] jlconvert(::JLD2.ReadRepresentation{…}, f::JLD2.JLDFile{…}, ptr::Ptr{…}, header_offset::JLD2.RelOffset) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\data\reconstructing_datatypes.jl:694 [11] read_scalar(f::JLD2.JLDFile{JLD2.MmapIO}, rr::Any, header_offset::JLD2.RelOffset) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\dataio.jl:37 [12] read_data(f::JLD2.JLDFile{…}, rr::Any, read_dataspace::Tuple{…}, attributes::Vector{…}) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\datasets.jl:238 [13] read_data(f::JLD2.JLDFile{…}, dataspace::JLD2.ReadDataspace, datatype_class::UInt8, datatype_offset::Int64, layout::JLD2.DataLayout, filters::JLD2.FilterPipeline, header_offset::JLD2.RelOffset, attributes::Vector{…}) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\datasets.jl:194 --- the last 6 lines are repeated 1 more time --- [20] load_dataset(f::JLD2.JLDFile{JLD2.MmapIO}, offset::JLD2.RelOffset) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\datasets.jl:125 [21] jlconvert(::JLD2.ReadRepresentation{…}, f::JLD2.JLDFile{…}, ptr::Ptr{…}, ::JLD2.RelOffset) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\data\writing_datatypes.jl:314 [22] macro expansion @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\dataio.jl:70 [inlined]
[23] macro expansion @ JLD2 .\simdloop.jl:77 [inlined] [24] read_array!(v::Vector{…}, f::JLD2.JLDFile{…}, rr::JLD2.ReadRepresentation{…})
@ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\dataio.jl:68 [25] read_array(f::JLD2.JLDFile{…}, dataspace::JLD2.ReadDataspace, rr::JLD2.ReadRepresentation, layout::JLD2.DataLayout, filters::JLD2.FilterPipeline, header_offset::JLD2.RelOffset, attributes::Vector{…}) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\datasets.jl:411 --- the last 22 lines are repeated 415 more times --- _datatypes.jl:736 [inlined] [9163] jlconvert(::JLD2.ReadRepresentation{…}, f::JLD2.JLDFile{…}, ptr::Ptr{…}, header_offset::JLD2.RelOffset) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\data\reconstructing_datatypes.jl:701 [9164] read_scalar(f::JLD2.JLDFile{JLD2.MmapIO}, rr::Any, header_offset::JLD2.RelOffset) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\dataio.jl:37 [9165] read_data(f::JLD2.JLDFile{…}, rr::Any, read_dataspace::Tuple{…}, attributes::Vector{…}) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\datasets.jl:238 [9166] read_data(f::JLD2.JLDFile{…}, dataspace::JLD2.ReadDataspace, datatype_class::UInt8, datatype_offset::Int64, layout::JLD2.DataLayout, filters::JLD2.FilterPipeline, header_offset::JLD2.RelOffset, attributes::Vector{…}) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\datasets.jl:194 [9167] load_dataset(f::JLD2.JLDFile{JLD2.MmapIO}, offset::JLD2.RelOffset) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\datasets.jl:125 [9168] getindex(g::JLD2.Group{JLD2.JLDFile{JLD2.MmapIO}}, name::String) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\groups.jl:110 [9169] getindex @ C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\JLD2.jl:492 [inlined] [9170] (::JLD2.var"#77#78"{String})(file::JLD2.JLDFile{JLD2.MmapIO}) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\loadsave.jl:241 [9171] jldopen(::Function, ::String, ::Vararg{String}; kws::@Kwargs{}) @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\loadsave.jl:4 [9172] jldopen @ JLD2 C:\Users\mwsoh.julia\packages\JLD2\twZ5D\src\loadsave.jl:1 [inlined] Some type information was truncated. Use show(err) to see complete types.

mwsohn commented 1 week ago

I do not have the same problem on a different computer. Consider this issue closed.