pmem / pynvm

Python bindings for the PMDK. Non-volatile memory for Python.
http://pynvm.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
13 stars 10 forks source link

how to persist numpy:ndarray #23

Open zhangyunzhao opened 5 years ago

zhangyunzhao commented 5 years ago

from nvm.pmemobj import PersistentObjectPool

data = np.load('/data/data/feature_100000_mat.npy') with PersistentObjectPool('hello_world.pmem', flag='c') as pool: if pool.root is None: pool.root = data

Traceback (most recent call last): File "", line 3, in File "/usr/lib64/python2.7/site-packages/nvm/pmemobj/pool.py", line 795, in root oid = self.mm.persist(value) File "/usr/lib64/python2.7/site-packages/nvm/pmemobj/pool.py", line 491, in persist raise TypeError("Don't know how to persist {!r}".format(cls_str)) TypeError: Don't know how to persist 'numpy:ndarray'

marcinslusarz commented 5 years ago

This repo is for issues in PMDK. pynvm issues are tracked in pynvm repo (https://github.com/pmem/pynvm/issues ).