# Can't load trace in the simplest case

**URL:** https://discourse.pymc.io/t/cant-load-trace-in-the-simplest-case/9948
**Category:** v3
**Tags:** arviz
**Created:** [July 19, 2022, 11:06am UTC](https://discourse.pymc.io/t/cant-load-trace-in-the-simplest-case/9948 "2022-07-19T11:06:04Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![jjj](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@jjj](https://discourse.pymc.io/u/jjj)
#### Post date: [July 20, 2022, 10:38am UTC](https://discourse.pymc.io/t/cant-load-trace-in-the-simplest-case/9948/3 "2022-07-20T10:38:07Z")

</div>

Thank you very much for your reply.

> [@OriolAbril](#):
>
> You can’t combine `save_trace` and `to_netcdf`.

I wasn’t doing that. Sorry, maybe the commented code was misleading. When using arviz, I would first run the code using `to_netcdf` (with `return_inference_data=True`) and then use `from_netcdf` to read the inference data.

> [@OriolAbril](#):
>
> InferenceData arguments also can’t be used as `trace` argument.

I thought `old.posterior` is an `xarray`? Do you mean that only `MultiTrace` can be used as a `trace` argument to start sampling where the process finished?

> [@OriolAbril](#):
>
> it is impossible it “starts sampling from where the old trace finished” (unless using a single chain).

That’s exactly my case! I want to use one chain, and start sampling from where I’ve finished. I just can’t figure out how to do it with arviz.

> [@OriolAbril](#):
>
> You can use [arviz.concat — ArviZ dev documentation](https://python.arviz.org/en/latest/api/generated/arviz.concat.html) to combine multiple posterior fits on the same model, either concating on the draw dimension (or probably recommended in this case unless you do have the mass matrix) on the chain dimension. That is, keep your current results, rerun `pm.sample` on the same model and then use `az.concat`

Thanks, that’s really helpful but from what I understand `arviz.concat` returns an `InferenceData` object. This still makes it impossible to start sampling from where the old trace finished, right? Do you know if this in general impossible with arviz? This is crucial to me, I am fitting a very slow model on a cluster. The model can fail for many reasons and I need to be able to save the sampling “state”.

**Update**  
Ok, I see [there exists a solution](https://discourse.pymc.io/t/saving-intermediate-results-using-mcmc-in-pymc4/9938/3) for a similar problem for pymc4. I’m not sure yet if this would work with pymc3.

---

_[View the full topic](https://discourse.pymc.io/t/cant-load-trace-in-the-simplest-case/9948)._
