-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
world age issue in loading closure #69
Comments
This is part of how Julia works: julia> function test()
f = eval(:(x -> x))
f(1)
end
test (generic function with 1 method)
julia> test()
ERROR: MethodError: no method matching (::var"#3#4")(::Int64)
The applicable method may be too new: running in world age 26764, while current world is 26765. So I'm not sure there's much we can do about it. I'd suggest that this is a bad code pattern and one should just stick to loading bson files at the toplevel. If you really need it, you can use |
I had similar problem too, I solved it by modifying the function I want to serialize in a way that all used variables are used as the input, so the function does not depend on the outer context. |
While working at FluxML/model-zoo#209, I encountered the following problem when loading a saved closure within the function
train
:Notice that if I just execute the body of the function in REPL, everything works fine:
The text was updated successfully, but these errors were encountered: