Skip to content
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

LearnerND not loading properly #461

Open
MrCheatak opened this issue Aug 8, 2024 · 1 comment
Open

LearnerND not loading properly #461

MrCheatak opened this issue Aug 8, 2024 · 1 comment

Comments

@MrCheatak
Copy link

Consider a problem, where one would like to save an intermediate learning result and continue later. i.e. to increase accuracy.

Saving and loading Learner2D works like charm and I can continue where I left off, but loading a LearnerND throws an error: learner.function cannot be pickled.

Here is a reproducible example for a notebook:

from adaptive import LearnerND, Runner, notebook_extension
notebook_extension()

def sphere(xyz):
    x, y, z = xyz
    return x**2 + y**2 + z**2

fname = r'sphere_learned.pkl'
learner = LearnerND(sphere, bounds=[(-3, 3), (-3, 3), (-3, 3)])
runner = Runner(learner, loss_goal=0.01, ntasks=4)
runner.live_info()
runner.start_periodic_saving(save_kwargs=dict(fname=fname), interval=10)
learner = LearnerND(sphere, bounds=[(-3, 3), (-3, 3), (-3, 3)])
learner.load(fname)
runner = Runner(learner, loss_goal=0.001)
@basnijholt
Copy link
Member

Thank you for reporting this! I will look into it ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants