Open f0lie opened 2 months ago
Thanks for the report, this issue is being tracked here: https://github.com/google/bayesnf/issues/36
Specifically, this is coming from using a JointDistributionCoroutine
, which dynamically generates a StructTuple to represent the state, which means pickle
can't represent it.
Depending on what kind of object models['states']['birth_rate']
is, you may be able to use arviz
import arviz as az
idata = az.from_pytree(models['states']['birth_rate'])
idata.to_netcdf("models.nc")
models = az.from_netcdf("models.nc") # To reload
Results the error message.