# Error trying to save OPF model

**URL:** <https://discourse.numenta.org/t/error-trying-to-save-opf-model/5037>\
**Category:** NuPIC\
**Created:** [December 7, 2018, 8:03pm UTC](https://discourse.numenta.org/t/error-trying-to-save-opf-model/5037 "2018-12-07T20:03:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Purestare3](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@Purestare3](https://discourse.numenta.org/u/Purestare3)\
**Post date:** [December 7, 2018, 8:03pm UTC](https://discourse.numenta.org/t/error-trying-to-save-opf-model/5037/1 "2018-12-07T20:03:40Z")

</div>

Hi folks! I think I come across some issue when trying to save the OPF model using

```auto
model.disableLearning()
model.save('/Users/myname/Documents/python/HTM/src/model/OPF.model')

```

The error are like following:

```auto
Traceback (most recent call last):
  File "/Users/myname/Documents/python/HTM/src/OPF.py", line 413, in <module>
    model.save('/Users/myname/Documents/python/HTM/src/model/OPF.model')
  File "/Users/myname/Documents/python/HTM/venv/lib/python2.7/site-packages/nupic/frameworks/opf/model.py", line 360, in save
    self._serializeExtraData(extraDataDir=self._getModelExtraDataDir(saveModelDir))
  File "/Users/myname/Documents/python/HTM/venv/lib/python2.7/site-packages/nupic/frameworks/opf/htm_prediction_model.py", line 1429, in _serializeExtraData
    self._netInfo.net.save(outputDir)
  File "/Users/myname/Documents/python/HTM/venv/lib/python2.7/site-packages/nupic/engine/ __init__.py", line 729, in save
    engine_internal.Network.save(self, *args, **kwargs)
  File "/Users/myname/Documents/python/HTM/venv/lib/python2.7/site-packages/nupic/bindings/engine_internal.py", line 1214, in save
    return _engine_internal.Network_save(self, *args, **kwargs)
SystemError: NULL result without error in PyObject_Cal

```

Can anybody help me with this? I have been stuck here for a long time. Thanks!

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [December 7, 2018, 8:05pm UTC](https://discourse.numenta.org/t/error-trying-to-save-opf-model/5037/2 "2018-12-07T20:05:21Z")

</div>

I’m not sure that NuPIC is installed correctly. How did you install it?

---

<div class="post-metadata">

**Author:** ![Purestare3](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@Purestare3](https://discourse.numenta.org/u/Purestare3)\
**Post date:** [December 7, 2018, 8:11pm UTC](https://discourse.numenta.org/t/error-trying-to-save-opf-model/5037/3 "2018-12-07T20:11:26Z")

</div>

Thanks Rhyolight!  
I think I install nupic in Pycharm CE, and I use Python 2.7. I’d appreciate any suggestions or experience. Thanks!

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [December 7, 2018, 8:13pm UTC](https://discourse.numenta.org/t/error-trying-to-save-opf-model/5037/5 "2018-12-07T20:13:31Z")

</div>

I would suggest you do not install NuPIC through an IDE. Do you know how to use `pip`? I suggest you install nupic with `pip`.

---

<div class="post-metadata">

**Author:** ![Purestare3](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@Purestare3](https://discourse.numenta.org/u/Purestare3)\
**Post date:** [December 7, 2018, 11:04pm UTC](https://discourse.numenta.org/t/error-trying-to-save-opf-model/5037/6 "2018-12-07T23:04:25Z")

</div>

Thanks Rhoylight! I have tried the way you suggested. I can generate anomaly score but still the same error shows up when I tried to save the model.

By the way, I think maybe python 2 has some bug in pickling large arrays, which leads to this SystemError as you described in [https://github.com/numenta/nupic/issues/1231](https://github.com/numenta/nupic/issues/1231), which I really appreciate. But seems like this python bug has already been resolved in environment \>= python 3.3. So I am wondering if nupic has already been compatible with python 3.3+? If not, I’d appreciate any suggestion/reference on how to set model parameters so that the array size will not exceed the array limit when saving the model?

I’d appreciate any suggestion. Thanks!
