[Numpy-discussion] MemoryError in numpy.test() on AIX installation

Charles R Harris charlesr.harris@gmail....
Mon Apr 27 14:39:54 CDT 2009


On Mon, Apr 27, 2009 at 1:12 PM, Whitcomb, Mr. Tim <
tim.whitcomb@nrlmry.navy.mil> wrote:

> I'm trying to install NumPy 1.3.0 on an IBM Power6.  I can build and
> install successfully, but when I try to execute the unit test suite it
> crashes with a MemoryError (with no additional information on the error
> - just the traceback).  The failure occurs in test_roundtrip in
> numpy/lib/tests/test_format.py and the following snippet reproduces the
> error:
>
> ----------------------------------
> import numpy as np
> from cStringIO import StringIO
> from numpy.lib import format
>
> f = StringIO()
> a = np.array([], dtype='object')
> format.write_array(f, a)
> f2 = StringIO(f.getvalue())
> a2 = format.read_array(f2)
>
> print('%s %s' % (a, a2))
> -----------------------------------
>
> On the AIX/PPC install, this crashes with:
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "crash_numpy.py", line 10, in <module>
>    a2  = format.read_array(f2)
>  File
> "$HOME/.local/python/lib/python2.5/site-packages/numpy/lib/format.py",
> line 362, in read_array
>    array = cPickle.load(fp)
> MemoryError
>

I think this means out of memory, which is probably not correct. What
happens if you simply pickle and object array? Something like

In [1]: import cPickle

In [2]: a = np.array([], dtype='object')

In [3]: cPickle.dump(a,open('foo.pkl','w'))

In [4]: b = cPickle.load(open('foo.pkl','r'))

In [5]: b
Out[5]: array([], dtype=object)

If that fails, try it using pickle instead of cPickle, then with a non-empty
object array like a = np.array([None,None], dtype='object')

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090427/8e76ccc1/attachment.html 


More information about the Numpy-discussion mailing list