# Saving/Loading PyMC3 model with InferenceData

**URL:** <https://discourse.pymc.io/t/saving-loading-pymc3-model-with-inferencedata/7970>\
**Category:** Questions\
**Created:** [August 31, 2021, 11:57pm UTC](https://discourse.pymc.io/t/saving-loading-pymc3-model-with-inferencedata/7970 "2021-08-31T23:57:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hectormz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/hectormz/32/1799_2.png) [@hectormz](https://discourse.pymc.io/u/hectormz)\
**Post date:** [August 31, 2021, 11:57pm UTC](https://discourse.pymc.io/t/saving-loading-pymc3-model-with-inferencedata/7970/1 "2021-08-31T23:57:22Z")

</div>

If I save a resulting InferenceData object to .nc and load again, is there any way to recover the original information stored in the PyMC3 model object? If I run analysis once, but want to save to disk and load again in the future, I don’t have ready access to the model structure (I think) and would love to run pm.model\_to\_graphviz(loaded\_model). Do I need to just pickle the model object separately, or is there something I don’t know about InferenceData?

---

<div class="post-metadata">

**Author:** ![twiecki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/twiecki/32/6930_2.png) [@twiecki](https://discourse.pymc.io/u/twiecki)\
**Post date:** [September 5, 2021, 8:25pm UTC](https://discourse.pymc.io/t/saving-loading-pymc3-model-with-inferencedata/7970/2 "2021-09-05T20:25:50Z")

</div>

Yes, you would need to pickle that separately, or recreate the model using code you stored somewhere.

We do plan to improve this workflow, see here for the proposal: [https://github.com/pymc-devs/pymc3/issues/4687](https://github.com/pymc-devs/pymc3/issues/4687)

---

<div class="post-metadata">

**Author:** ![hectormz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/hectormz/32/1799_2.png) [@hectormz](https://discourse.pymc.io/u/hectormz)\
**Post date:** [September 13, 2021, 4:15pm UTC](https://discourse.pymc.io/t/saving-loading-pymc3-model-with-inferencedata/7970/3 "2021-09-13T16:15:03Z")

</div>

Thanks for directing me to that @twiecki . That would definitely be a useful feature. I’ll move forward with recreation or pickling for now.
