Comments (4)
That makes more sense.
Ah, maybe I only tested on an older version of JLD2.
This was broken by #492
which apparently was an overly eager fix.
It should not define a custom serialization for <:AbstractDict
but only for the ones implementations of AbstractDict
.
from jld2.jl.
This is fixed on v0.4.38
from jld2.jl.
Hi @justinmimbs,
thanks for the report.
The error message above has little to do with JLD2.
julia> LRU{UInt64, String}()
ERROR: UndefKeywordError: keyword argument `maxsize` not assigned
Stacktrace:
[1] LRU{UInt64, String}()
@ LRUCache /data.lmp/isensee/.julia/packages/LRUCache/NCFtW/src/LRUCache.jl:21
When I construct a cache with the required maxsize
keyword, it works for me.
julia> jldsave("lru.jld2"; lru = LRU{UInt64,String}(maxsize=10))
julia> load("lru.jld2")
Dict{String, Any} with 1 entry:
"lru" => LRU{UInt64, String}(; maxsize = 10)
If the problem persists, you are welcome to provide more info :)
from jld2.jl.
Thanks, @JonasIsensee.
I'm sorry, I stripped my example too aggressively when posting it. 😅
Running the corrected example using JLD2 v0.4.36 gives me the same result you posted. However, running it using JLD2 v0.4.37 gives me the error as described.
julia> jldsave("lru.jld2"; lru = LRU{UInt64,String}(maxsize=10))
julia> load("lru.jld2")
Error encountered while load FileIO.File{FileIO.DataFormat{:JLD2}, String}("lru.jld2").
Fatal error:
ERROR: UndefKeywordError: keyword argument `maxsize` not assigned
Stacktrace:
[1] LRU{UInt64, String}()
@ LRUCache ~/.julia/packages/LRUCache/NCFtW/src/LRUCache.jl:21
[2] rconvert(#unused#::Type{LRU{UInt64, String}}, x::Vector{Pair{UInt64, String}})
@ JLD2 ~/.julia/packages/JLD2/z2UM4/src/data/specialcased_types.jl:252
[3] jlconvert(#unused#::JLD2.ReadRepresentation{LRU{UInt64, String}, JLD2.CustomSerialization{Array, JLD2.RelOffset}}, f::JLD2.JLDFile{JLD2.MmapIO}, ptr::Ptr{Nothing}, header_offset::JLD2.RelOffset)
@ JLD2 ~/.julia/packages/JLD2/z2UM4/src/data/custom_serialization.jl:57
[4] read_scalar(f::JLD2.JLDFile{JLD2.MmapIO}, rr::JLD2.ReadRepresentation{LRU{UInt64, String}, JLD2.CustomSerialization{Array, JLD2.RelOffset}}, header_offset::JLD2.RelOffset)
@ JLD2 ~/.julia/packages/JLD2/z2UM4/src/dataio.jl:37
[5] read_data(f::JLD2.JLDFile{JLD2.MmapIO}, rr::Any, read_dataspace::Tuple{JLD2.ReadDataspace, JLD2.RelOffset, JLD2.DataLayout, JLD2.FilterPipeline}, attributes::Vector{JLD2.ReadAttribute})
@ JLD2 ~/.julia/packages/JLD2/z2UM4/src/datasets.jl:238
Can you please confirm this does not error for you using these versions?
[033835bb] JLD2 v0.4.37
[8ac3fa9e] LRUCache v1.5.0
Thanks for your help.
from jld2.jl.
Related Issues (20)
- File saved in Julia 1.10.0-beta3 cannot be loaded in Julia 1.10.0-rc1 with Random.Xoshiro HOT 5
- Don't map back to Julia composite type HOT 2
- Optional plain HDF5 data mapping without reconstruction of data source type HOT 10
- Dict of mutable struct reconstruction fails with newer JLD2 versions HOT 1
- Out of disk space throws generic Bus Error HOT 3
- jldopen(filename, "w";) will fail in win7 HOT 2
- Saving vector of dictionaries initialized as #undef gives "This should not have happened" HOT 2
- error when serializing expression containing `Int128` HOT 4
- occasional corruption while loading `Matrix{Rational{BigInt}}` HOT 3
- Possible bug with version 0.4.42 HOT 6
- Error loading file saved with v0.4.41 on v0.4.43 HOT 1
- JLD2 writes zeros to first 3440 bytes in file HOT 4
- Cannot read custom struct with Dict subfield just written to jld file. HOT 2
- Reconstruction of UnionAll type parameters
- Add flag to disallow committing structs
- File created with earlier JLD2 version can't be opened with version 0.4.38 or later HOT 5
- JLD2 is failed to precompile on the latest nightly HOT 1
- How to print or show every group name of a JLD2 file HOT 2
- Manually flush written data to file HOT 2
- Saving/Reloading a struct with more than 255 fields leads to a "missing field" warning & corrupted loads HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jld2.jl.