pymc-devs / pymc2

THIS IS THE **OLD** PYMC PROJECT (VERSION 2). PLEASE USE PYMC INSTEAD:
http://pymc-devs.github.com/pymc/
Other
879 stars 229 forks source link

Are there any direct ways to restart sampling from a pickled database object? #168

Closed mar-ses closed 6 years ago

mar-ses commented 6 years ago

Hey, say I define and sample a model

M = pymc.MCMC(node_list, db='pickle', dbname='filename.pickle')
M.sample(1000, 500, 5)
M.db.close()

And I load the database:

db = pymc.database.pickle.load('filename.pickle')

When I try to reload this into an MCMC object with M = pymc.MCMC(node_list, db=db) I get a UserWarning: Failed to restore state of stochastic __ from pickle backend for each Node.

EDIT: I'm still not sure why, but I think this may be due to the node_list actually having different attributes from the nodes stored in the database. When I tried to reproduce this with a different model, it seemed to work fine instead. My bad.